aglinxinyuan commented on code in PR #5700:
URL: https://github.com/apache/texera/pull/5700#discussion_r3565621932
##########
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(
+ JumpToOperatorRegionRequest(OperatorIdentity(self._loop_start_id))
+ )
+ writer = DocumentFactory.create_document(uri, State.SCHEMA).writer("0")
Review Comment:
Done — extended `complete()`'s guard to cover the whole jump call (one `try`
over `condition()` + `_jump_to_loop_start`), so a `put_one`/`close` failure
after the jump DCM is reported via `Context.report_exception` + EXCEPTION_PAUSE
and completion is skipped, exactly like the condition path. Added
`test_complete_reports_loopback_write_error_instead_of_crashing`, which drives
a real `put_one` failure through the guard. (The missing-URI `RuntimeError` now
also gets reported instead of killing the thread; the fail-loud-before-DCM
ordering inside `_jump_to_loop_start` is unchanged.) (38338f8)
--
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]