fix: close tmp fs and evict udf modules on ExecutorManager.close()#5046
Merged
Conversation
Contributor
Author
|
@chenlica please assign a reviewer. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5046 +/- ##
============================================
+ Coverage 42.81% 43.37% +0.55%
+ Complexity 2206 2172 -34
============================================
Files 1045 1035 -10
Lines 40119 38750 -1369
Branches 4239 4051 -188
============================================
- Hits 17178 16806 -372
+ Misses 21875 20892 -983
+ Partials 1066 1052 -14
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Contributor
|
Also please make coverage happy ;) thanks |
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.
What changes were proposed in this PR?
The
executor_managerfixture intest_executor_manager.pyguarded its cleanup withhasattr(manager, "_fs"), but the@cached_propertyattribute is namedfs, so the guard was always false andmanager.close()never ran. This leakedTempFSdirectories into/var/tmpon every test run. Even whenclose()did run from the sibling fixture, it only closed the filesystem and left staleudf-vNentries insys.modulesplus the tmp directory insys.path. This PR drops the broken guard and extendsExecutorManager.close()to also remove the module fromsys.modulesand the path fromsys.path, so a singleclose()call fully reverses every global side effect offsandload_executor_definition.Any related issues, documentation, or discussions?
Closes: #4730
How was this PR tested?
test_executor_manager.pypass./var/tmpno longer accumulatesTempFSdirectories after a test run.udf-v*files anywhere under/tmpor/var/tmpafter a run.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.7 in compliance with ASF