Repository navigation
End an interrupted query in a kernel as Query interrupted - #812
Merged
Merged
Conversation
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.
In a Jupyter kernel, an interrupt that arrives while the progress widget shows ends the query with the wrong exception:
The widget's update runs Python on the query's thread after every task, so Python raises the pending SIGINT inside the widget's code. The display let that
KeyboardInterruptfail the query as an ordinary error, and the client's own interrupt check never saw the signal.Update()now sets the signal again and returns, so that check ends the query withRuntimeError: Query interrupted. Every other Python error of the widget still fails the statement as before.The widget also got only its style: an extra pair of parentheses made its keyword arguments one comma expression, so
minandmaxwere dropped. They are now passed. Users see no difference, as 0 and 100 are the ipywidgets defaults.A cursor still shows no progress in a kernel. Releasing the widget under the GIL and taking the GIL through the client's shutdown gate are left to separate work.
The new
tests/fast/api/test_jupyter_progress_bar.pystarts a real kernel and reads the widget messages. It usesipykernelandipywidgets, now test dependencies. The tests cover the arguments, an interrupt from a timer and one raised inside the widget, one widget per statement that ends at 100, a query that fails midway, a widget that raises, and a clean exit. The arguments and interrupt tests fail on the merge base.The release line
v2.0-cyanopterahas the same two defects, and the fix should be ported there.