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

stop control thread before closing sockets on it #659

Merged
merged 1 commit into from
May 7, 2021

Conversation

minrk
Copy link
Member

@minrk minrk commented May 7, 2021

closing sockets while they are still in use by another thread is a recipe for SIGABRT.

skip close(all_fds=True) in favor of explicit cleanup of sockets

I believe this fixes the nbclient failures in test_many_parallel_notebooks mentioned here.

I'm not sure why that test would have triggered it and not others, but it was readily reproducible for me and doesn't happen anymore after this.

@minrk minrk requested a review from davidbrochart May 7, 2021 12:08
Copy link
Collaborator

@davidbrochart davidbrochart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know about the failures in ipykernel, but it fixed nbclient:
jupyter/nbclient#146

closing sockets in-use by another thread is a recipe for SIGABRT

skip `close(all_fds=True)` in favor of explicit cleanup of sockets
@minrk
Copy link
Member Author

minrk commented May 7, 2021

failures were due to a missing check for is_alive, since this can still get called if the app never finishes starting. Should be okay, now.

@davidbrochart davidbrochart merged commit 31ec597 into ipython:master May 7, 2021
@davidbrochart
Copy link
Collaborator

Great, thanks!

@minrk minrk deleted the safe-close branch May 7, 2021 13:27
try:
self.io_loop.start()
finally:
self.io_loop.close()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Carreau Carreau added this to the 6.0 milestone Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants