Tree: close temporary tar files used by copy and rcopy#681
Open
thiell wants to merge 1 commit into
Open
Conversation
Signed-off-by: Stephane Thiell <stephane@thiell.com>
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.
TreeWorker never closes its temporary tar files: one per forward copy worker, one per rcopy source node. Their file descriptors stay open until the file objects are garbage-collected, which is deferred by reference cycles — and for a timed-out rcopy node cannot happen before the worker object itself is released. This means
ResourceWarning: unclosed filenoise in warning-enabled runs and open-fd accumulation in long-running processes embedding the library. Found while writing the tree copy tests for #680.withblock in_launch()_on_remote_node_close()—TarFile.close()does not close a caller-providedfileobj_check_fini(), and drop data arriving after a node's terminal event (the gateway's final grooming flush follows itsTimeoutMessage), so the cleanup is final