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


##########
amber/src/main/python/core/runnables/data_processor.py:
##########
@@ -49,20 +49,17 @@ def run(self) -> None:
         with self._context.tuple_processing_manager.context_switch_condition:
             
self._context.tuple_processing_manager.context_switch_condition.wait()
         self._running.set()
-        self._switch_context()

Review Comment:
   If we keep this `_switch_context()`, MainLoop's first switch is consumed by 
a no-op handshake (DP wakes, sets `_running`, notifies, waits — executor hasn't 
run), so MainLoop reads `current_output_state == None` and silently drops the 
first state/tuple/marker. That's the original #4421 / #4559 bug.
   
   Replaced with a direct `_post_switch_context_checks()` call in `d890004c11` 
— same debug-command / console / exception checks before the first task, 
without a wasted round-trip. WDYT?



##########
amber/src/main/python/core/runnables/main_loop.py:
##########
@@ -192,7 +192,6 @@ def process_input_tuple(self) -> None:
     def process_input_state(self) -> None:
         self._switch_context()
         output_state = self.context.state_processing_manager.get_output_state()
-        self._switch_context()

Review Comment:
   I don't think so — DP is blocked on `wait()` after its per-task `finally` 
notifies MainLoop. Nothing between MainLoop's `get_output_state()` and the next 
state cycle touches the condition variable, so DP can't advance. The removed 
second switch was a no-op round-trip (DP exits finally, re-parks, notifies 
back, no new task runs).



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