-
Notifications
You must be signed in to change notification settings - Fork 793
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
fix: Eliminate the exception during shutdown #3826
Conversation
3effaab
to
ede36c3
Compare
Just tried this and if you kill the server in training you get
instead, which doesn't seem much better? |
@sauyon Thanks for that info. I tested on Python 3.7(which I didn't do previously), it looks good after I reraise the exception. |
L180 is intentional to return a fallback value. L316 doesn't make a difference since it is a top async task on its own, but IMO it has a slight mismatch in semantic: a cancellation should not be a normal return. I will change it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this LGTM! Not sure why I didn't reraise in the training code and added the raise elsewhere...
NVM, it may come from a refactor when the logic is extracted into a function |
@aarnphm are unit tests broken? |
Oh we need to install Pillow in our tests. Let me make a quick PR for that |
Signed-off-by: Frost Ming <[email protected]>
Signed-off-by: Frost Ming <[email protected]>
Signed-off-by: Frost Ming <[email protected]>
Signed-off-by: Frost Ming <[email protected]>
20dc772
to
bd2a21a
Compare
Signed-off-by: Frost Ming [email protected]
What does this PR address?
Fixes #3813
A bug that causes the runner to keep running after it is terminated. This is because the CancelledError is swallowed silently, making the tasks never be cancelled by the runner.
BTW, since
CancelledError
is subclassingBaseException
it won't be caught by theexcept Exception
block. We can remove it.Before submitting:
guide on how to create a pull request.
make format
andmake lint
script have passed (instructions)?those accordingly? Here are documentation guidelines and tips on writting docs.