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

Fix __del__ excep #685

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

douglas-raillard-arm
Copy link
Contributor

Fixes #684

This PR is untested for now.

Allow cleanly disconnecting the Target object, so that we don't get
garbage output from __del__ later on when half of the namespace has
already disappeared.
Ensure the connections that Target.disconnect() closes do not stay
around in case the Target object is later reused.
Use atexit handler to run Target.disconnect() when the process is about
to exit. This avoids running it with a half torn down namespace, with
ensuing exceptions and non-clean disconnect.
@douglas-raillard-arm
Copy link
Contributor Author

PR updated to also disconnect upon process exit, before the modules are torn down. This should prevent getting exceptions logged in __del__ in common cases, for anything that is cleaned-up in Target.disconnect() (which includes all current connection objects)

@douglas-raillard-arm douglas-raillard-arm changed the title [Draft] Fix __del__ excep Fix __del__ excep May 8, 2024
@marcbonnici marcbonnici merged commit 5228105 into ARM-software:master Jun 12, 2024
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.

utils.ssh.SshConnectionBase issues caused by garbage collection
2 participants