fix possible resource leak on PostgreSQL access#208
Closed
SanshiroEnomoto wants to merge 1 commit into
Closed
Conversation
- The conn.close() method must be called to avoid resource leakage. - This is automatically done when the conn variable is deleted (we should not rely on this, though). - Often the conn variable is automatically deleted when returned from the function; however, - if an exception happens, all the local variables are capcured by the traceback object and raised to the caller, - causing the garbage collector not removing it. - We actually obverved resource leakage that led to reliable crashes after 90 min when exceptions are constantly thrown, - and the crashing stopped after stopping the exception (writing data before the endpoint entry is made on the mane-id map). - It is not clear yet why the traceback objects are not deleted on the next exception, - but given the observations, doing this good practice (explicit resource management) would be a good thing anyway.
Contributor
|
I think this is already resolved on the develop branch (as of #200), and should be implemented in the next dl-py release The "Files Changed" tab is useless because the git histories have diverged, so @SanshiroEnomoto please verify. |
Author
|
Yes, the PL #200 includes the same changes. |
Member
|
Closing this PR since the changes are already implemented from another PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
The conn.close() method must be called to avoid resource leakage. This is automatically done when the conn variable is deleted (we should not rely on this, though), and often the conn variable is automatically deleted when returned from the function; however, if an exception happens, all the local variables are capcured by the traceback object and raised to the caller, causing the garbage collector not removing it.
We actually observed resource leakage that led to reliable crashes after 90 min when exceptions are constantly thrown, and the crashing stopped after stopping the exception (writing data before the endpoint entry is made on the name-id map). It is not clear yet why the traceback objects are not deleted on the next exception, but given the observations, doing this good practice (explicit resource management) would be a good thing anyway.
Testing
I didn't run any test. I did not even run the updated script.
Prior to merging for releases:
CMakeLists.txtfileappVersionto be the new container image tag version inchart/Chart.yaml