Skip to content

Conversation

@minrk
Copy link
Member

@minrk 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
Copy link
Member

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

@takluyver takluyver merged commit 162cf6f into jupyter:master Jan 17, 2018
takluyver added a commit that referenced this pull request Jan 17, 2018
@minrk minrk deleted the atexit-teardown branch January 22, 2018 10:37
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.

HBChannel._exiting = True, AttributeError: 'NoneType' object has no attribute '_exiting'

3 participants