-
Notifications
You must be signed in to change notification settings - Fork 8
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
Avoid calling cleanup from destructor #168
Conversation
This comment has been minimized.
This comment has been minimized.
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.
LGTM! Thanks!
@cattabiani Once this change is deployed, in multiscale_run you will have to remove cleanup_atexit
from calling neurodamus.
b4fd6ae
to
a636f3d
Compare
This comment has been minimized.
This comment has been minimized.
Shall we merge this PR ? |
Looks good to me! |
a636f3d
to
a541267
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Tests just failed because pytest-forked depends on py.process which went away. pytest-dev/pytest-forked#88 |
This comment has been minimized.
This comment has been minimized.
5c2e841
to
fa58d2e
Compare
This comment has been minimized.
This comment has been minimized.
8e1fcb6
to
b7856b9
Compare
This comment has been minimized.
This comment has been minimized.
b7856b9
to
5f8f84f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5f8f84f
to
5e2fe82
Compare
This comment has been minimized.
This comment has been minimized.
11423ff
to
be0b856
Compare
Logfiles from GitLab pipeline #211543 (:no_entry:) have been uploaded here! Status and direct links: |
## Context Neurodamus used to ensure `cleanup` was called by calling it from the destructor of the `Neurodamus` class. However, depending on the python version, this could lead to crashes as some objects from `Node` eventually were already destroyed. To workaround this problem, at some point we introduced the `cleanup_atexit` parameter which would skip over this procedure, and notably multiscale_run was using it. However this was not a solution as cleanup was not being called. ## Scope This PR fixes this long standing issue. Cleanup is now called directly from the top-level `run()` function. It can still be avoided if the user really wants to keep the data, with the parameter `cleanup=False` ## Testing CI is happy. ## Review * [x] PR description is complete * [x] Coding style (imports, function length, New functions, classes or files) are good
## Context Neurodamus used to ensure `cleanup` was called by calling it from the destructor of the `Neurodamus` class. However, depending on the python version, this could lead to crashes as some objects from `Node` eventually were already destroyed. To workaround this problem, at some point we introduced the `cleanup_atexit` parameter which would skip over this procedure, and notably multiscale_run was using it. However this was not a solution as cleanup was not being called. ## Scope This PR fixes this long standing issue. Cleanup is now called directly from the top-level `run()` function. It can still be avoided if the user really wants to keep the data, with the parameter `cleanup=False` ## Testing CI is happy. ## Review * [x] PR description is complete * [x] Coding style (imports, function length, New functions, classes or files) are good
Context
Neurodamus used to ensure
cleanup
was called by calling it from the destructor of theNeurodamus
class.However, depending on the python version, this could lead to crashes as some objects from
Node
eventually were already destroyed.To workaround this problem, at some point we introduced the
cleanup_atexit
parameter which would skip over this procedure, and notably multiscale_run was using it. However this was not a solution as cleanup was not being called.Scope
This PR fixes this long standing issue. Cleanup is now called directly from the top-level
run()
function. It can still be avoided if the user really wants to keep the data, with the parametercleanup=False
Testing
CI is happy.
Review