This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch 
gh-readonly-queue/main/pr-7173-45b7b20e05864bca98def642e329d501e664413e
in repository https://gitbox.apache.org/repos/asf/texera.git

commit 24a20c8e4b6f876082be35f6f5fba4833a122de8
Author: Neil Ketteringham <[email protected]>
AuthorDate: Fri Jul 31 11:40:06 2026 -0700

    fix(pyamber): Invalidate cache while loading executor_def. (#7173)
    
    ### What changes were proposed in this PR?
    This PR calls `importlib.invalidate_caches()` prior to importing newly
    written UDF modules in `ExecutorManager.load_executor_definition`.
    
    ### Any related issues, documentation, discussions?
    Fixes #7126
    
    ### How was this PR tested?
    Tested with existing Python unit tests:
    *
    
`amber/src/test/python/core/architecture/managers/test_executor_manager.py::TestUpdateExecutor::test_repeated_updates_keep_carrying_the_running_state`
    
    Verified that rapid sequential executor updates cleanly load without
    throwing `ModuleNotFoundError`.
    
    ### Was this PR authored or co-authored using generative AI tooling?
    No.
---
 amber/src/main/python/core/architecture/managers/executor_manager.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/amber/src/main/python/core/architecture/managers/executor_manager.py 
b/amber/src/main/python/core/architecture/managers/executor_manager.py
index 7f2249476a..375033ad60 100644
--- a/amber/src/main/python/core/architecture/managers/executor_manager.py
+++ b/amber/src/main/python/core/architecture/managers/executor_manager.py
@@ -99,6 +99,9 @@ class ExecutorManager:
             f"{Path(self.fs.getsyspath('/')).joinpath(file_name)}."
         )
 
+        # Clear importlib's directory listing cache so freshly written
+        # temporary modules are discoverable on systems with coarse mtime.
+        importlib.invalidate_caches()
         # gen_module_file_name guarantees module_name is unique across
         # the process, so import_module will always cleanly load source
         # from the tmp fs we just wrote — no re-import / reload dance.

Reply via email to