Yicong-Huang commented on code in PR #4717:
URL: https://github.com/apache/texera/pull/4717#discussion_r3177673886


##########
amber/src/main/python/core/architecture/managers/executor_manager.py:
##########
@@ -60,11 +73,13 @@ def fs(self) -> FS:
 
     def gen_module_file_name(self) -> Tuple[str, str]:
         """
-        Generate a UUID to be used as udf source code file.
+        Generate a unique module name and corresponding tmp file name.
+        Names come from a process-wide monotonic counter so they never
+        collide with any module already in `sys.modules`, even when
+        multiple ExecutorManager instances live in the same process.

Review Comment:
   we should be fine now



##########
amber/src/main/python/core/architecture/managers/test_executor_manager.py:
##########
@@ -200,18 +202,26 @@ def test_reject_other_unsupported_languages(self, 
executor_manager):
             pass
 
     def test_gen_module_file_name_increments(self, executor_manager):
-        """Test that module file names increment correctly."""
-        module1, file1 = executor_manager.gen_module_file_name()
-        assert module1 == "udf-v1"
-        assert file1 == "udf-v1.py"
+        """Test that module file names increment monotonically.
 
+        The counter is process-wide so the absolute starting value
+        depends on prior tests in the same pytest session; only the
+        relative ordering matters for correctness.
+        """
+        module1, file1 = executor_manager.gen_module_file_name()
         module2, file2 = executor_manager.gen_module_file_name()
-        assert module2 == "udf-v2"
-        assert file2 == "udf-v2.py"
-
         module3, file3 = executor_manager.gen_module_file_name()
-        assert module3 == "udf-v3"
-        assert file3 == "udf-v3.py"
+
+        def version(module_name: str) -> int:

Review Comment:
   should be fine



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to