You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ExecutorManager can fail to import a freshly written UDF module with ModuleNotFoundError because importlib caches are not invalidated #7126
ExecutorManager.load_executor_definition writes the UDF code to a new module file on its tmp filesystem and immediately calls importlib.import_module, without calling importlib.invalidate_caches() first. Python's FileFinder caches each directory listing keyed on the directory's mtime. When two executor updates land within the filesystem's timestamp granularity, the second module file is invisible to the import system and import_module raises ModuleNotFoundError (e.g. No module named 'udf-v21'). Expected: every initialize_executor / update_executor call imports the module it just wrote — the Python docs require invalidate_caches() after creating a module file at runtime.
How to reproduce?
Call update_executor twice in quick succession so both module files are written within the filesystem's mtime granularity window; the second import fails. src/test/python/core/architecture/managers/test_executor_manager.py::TestUpdateExecutor::test_repeated_updates_keep_carrying_the_running_state reproduces this reliably on filesystems with coarse mtime resolution (e.g. overlayfs); on ext4 it depends on timing.
FAILED src/test/python/core/architecture/managers/test_executor_manager.py::TestUpdateExecutor::test_repeated_updates_keep_carrying_the_running_state - ModuleNotFoundError: No module named 'udf-v21'
Activity
Neilk1021 commentedon Jul 31, 2026
/take
fix(pyamber): Invalidate cache while loading executor_def. (apache#7173)