Repository navigation
Fix inability to interrupt processes on Windows - #12137
Merged
Merged
Conversation
Contributor
Author
|
I now have a process interrupting test that simulates how ipykernel handles interrupts, and it demonstrates that
|
Contributor
Author
|
It appears the subprocess also becomes uninterruptible while reading, not just during |
itamarst
marked this pull request as ready for review
February 26, 2020 18:48
Contributor
Author
|
Investigating the Travis failure. |
Member
|
Well you seem to know what you are doing and have a windows machine. I can't test, but the code seem reasonable. Thanks ! |
meeseeksmachine
pushed a commit
to meeseeksmachine/ipython
that referenced
this pull request
Feb 27, 2020
Carreau
added a commit
that referenced
this pull request
Feb 27, 2020
…137-on-7.x Backport PR #12137 on branch 7.x (Fix inability to interrupt processes on Windows)
|
Should this be working in IPython version 7.15.0? I couldn't get it to work. |
Contributor
Author
|
@amrita112 you also need the newest IPykernel. |
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.
Fixes #3400
(or at least fixes the Windows subprocesses variant; there's a bunch of stuff in there that is probably separate tickets—at least pdb was moved out into its own).
It appears that in addition to wait() being uninterruptible (https://bugs.python.org/issue28168), so is read()ing from the subprocess.
Reading is therefore pushed off to threads, and
wait()replaced with the equivalentpoll()-based loop. If the user interrupts the process, it is killed.This is demonstrated by a unit test that previously failed, and now passes. Still remaining for me to do is actually test this fix on Windows from Jupyter; I'm waiting for a VM to unpack. If a reviewer wants to try this out themselves, by all means do so :)