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

handle classes having been torn down in atexit #336

Merged
merged 1 commit into from Jan 17, 2018

Conversation

@minrk
Copy link
Member

minrk commented Jan 16, 2018

we could probably avoid this if we registered/unregistered atexit callbacks for instances instead of registering it once for classes at import time

closes #323

Perhaps more hygenic, if more complex alternative that would use instances:

  • register atexit callback in __init__
  • use a weakref to avoid keeping a reference forever
  • unregister callback in __del__

Attaching it to an instance should prevent any process-teardown issues, since classes don't get deleted while they still have running instances (I'm pretty sure).

we could probably avoid this if we registered/unregistered atexit callbacks for instances
instead of registering it once for classes at import time
@takluyver takluyver added this to the 5.3 milestone Jan 17, 2018
@takluyver

This comment has been minimized.

Copy link
Member

takluyver commented Jan 17, 2018

I'm happy enough with this simple but somewhat dirty approach.

@rgbkrk
rgbkrk approved these changes Jan 17, 2018
@takluyver takluyver merged commit 162cf6f into jupyter:master Jan 17, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
meeseeksdev bot pushed a commit that referenced this pull request Jan 17, 2018
takluyver added a commit that referenced this pull request Jan 17, 2018
Backport PR #336 on branch 5.x
@minrk minrk deleted the minrk:atexit-teardown branch Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.