Conversation
zanieb
commented
Jan 27, 2025
| // Ignore signals in the parent process, deferring them to the child. This is safe as long as | ||
| // the command is the last thing that runs in this process; otherwise, we'd need to restore the | ||
| // signal handlers after the command completes. | ||
| let _handler = tokio::spawn(async { while tokio::signal::ctrl_c().await.is_ok() {} }); |
Member
Author
There was a problem hiding this comment.
Need to figure out what this means for Windows before ready for review.
zanieb
commented
Jan 27, 2025
Comment on lines
+29
to
+34
| _ = int_signal.recv() => { | ||
| int_signal_count += 1; | ||
| if int_signal_count > 1 { | ||
| let _ = interrupt_process(&mut handle); | ||
| } | ||
| }, |
Member
Author
There was a problem hiding this comment.
I'd like to understand why Ctrl-C isn't working in #10952 but works in other cases, but... it seems generally correct to forward a SIGINT if we've received it multiple times (as an escape hatch).
zanieb
commented
Jan 27, 2025
| break result; | ||
| }, | ||
|
|
||
| // TODO(zanieb: Refactor `interrupt_process` and `terminate_process` to use |
Member
Author
There was a problem hiding this comment.
Keeping this separate for review purposes.
zanieb
added a commit
that referenced
this pull request
Jan 28, 2025
There should be two functional changes here: - If we receive SIGINT twice, forward it to the child process - If the `uv run` child process changes its PGID, then forward SIGINT Previously, we never forwarded SIGINT to a child process. Instead, we relied on shell to do so. On Windows, we still do nothing but eat the Ctrl-C events we receive. I cannot see an easy way to send them to the child. The motivation for these changes should be explained in the comments. Closes #10952 (in which Ray changes its PGID) Replaces the (much simpler) #10989 with a more comprehensive approach. See #6738 (comment) for some previous context.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10952