fix(daemon): retry finished dataflow reports after reconnect - #3118
fix(daemon): retry finished dataflow reports after reconnect#3118SunSunSun689 wants to merge 1 commit into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
🤖 Automated review by Claude — this is a fully automated review with no human in the loop. Treat it as advisory. Reviewed the diff — no issues found. The reordering so that local cleanup (removing the dataflow from One minor, non-blocking note: on reconnect, if a stashed report fails to send again, the Generated by Claude Code |
Summary
Fixes a daemon cleanup ordering bug where finish_dataflow could leave a completed dataflow in the daemon’s local running map if reporting AllNodesFinished to the coordinator failed during a disconnect.
The fix makes local teardown independent from coordinator delivery:
signal listener shutdown and remove the dataflow from self.running before
reporting completion
keep the existing error return when coordinator reporting fails, so
reconnect behavior is preserved
store failed finish reports in pending_finished_dataflows
retry pending AllNodesFinished reports on the next coordinator connection
before sending StatusReport
This prevents the daemon from reporting an already-finished dataflow as still running after reconnect, while still giving the coordinator another chance to receive the terminal result.
Notes
This fixes the direct failure path where the coordinator send channel is already closed and send_event() returns an error. It does not change the broader fire-and-forget semantics of CoordinatorSender; if a message is accepted into the local send channel but the background websocket writer later fails, there is still no coordinator-level ack.