Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ultraman panics if a process is exiting early while processing the stdio of that process #55

Open
tardyp opened this issue Jan 15, 2024 · 3 comments · Fixed by #56
Open
Assignees
Labels
bug Something isn't working

Comments

@tardyp
Copy link

tardyp commented Jan 15, 2024

Steps to reproduce

Simple reproduce (my env is a bit different, and reproduce the panic 100%)

Profile:

early_out: seq 100
sleep: sleep 20

Expected behavior

full 100 lines are displayed to the terminal

Actual behavior

only few lines are displayed.
sometimes, a panic happens:

thread '' panicked at 'called Result::unwrap() on an Err value: "SendError(..)"', #44 $HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ultraman-0.3.1/src/stream_read.rs:44:38

It looks like there is a race-condition between catch of the SIGCHILD, and completion of the stdout/err processing.

System configuration

ultraman version:
0.3.1
Rust version:

@yukihirop yukihirop self-assigned this Feb 7, 2024
@yukihirop yukihirop mentioned this issue Mar 2, 2024
3 tasks
@yukihirop
Copy link
Owner

@tardyp

thank you ☺️

@yukihirop yukihirop added the bug Something isn't working label Mar 2, 2024
@yukihirop yukihirop reopened this Mar 2, 2024
@yukihirop
Copy link
Owner

full 100 lines are displayed to the terminal

It wasn't fixed

@yukihirop
Copy link
Owner

yukihirop commented Mar 3, 2024

I don't know how to fix it, but there was a problem here.
Observed returning EOF immediately...

ultraman/src/output.rs

Lines 37 to 44 in 3dc86f7

channels.push(PipeStreamReader::new(Box::new(
proc.lock()
.unwrap()
.child
.stderr
.take()
.expect("failed take stderr"),
)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants