aglinxinyuan commented on code in PR #5700:
URL: https://github.com/apache/texera/pull/5700#discussion_r3565426052


##########
amber/src/main/python/core/runnables/main_loop.py:
##########
@@ -87,19 +98,62 @@ def __init__(
             target=self.data_processor.run, daemon=True, 
name="data_processor_thread"
         ).start()
 
+    def _jump_to_loop_start(
+        self, executor: LoopEndOperator, coordinator_interface
+    ) -> None:
+        # The write address is setup config, keyed by the captured id. Fail
+        # loud BEFORE the jump RPC so a misconfigured loop does not rewind the
+        # schedule without a back-edge write.
+        uri = self.context.loop_start_state_uris.get(self._loop_start_id)
+        if not uri:
+            raise RuntimeError(
+                f"no loop-back state URI configured for LoopStart "
+                f"'{self._loop_start_id}' "
+                f"(have: {sorted(self.context.loop_start_state_uris)})"
+            )
+        coordinator_interface.jump_to_operator_region(

Review Comment:
   1. As I mentioned before, an infinite loop is expected behavior.
   2. Even if we wanted to detect infinite loops, it's nearly impossible to do 
so at compile time because the loop condition may depend on runtime data.



-- 
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