You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "DanielLeens (via GitHub)" <gi...@apache.org> on 2026/09/05 16:20:07 UTC
[I] [Improve][Zeta] Bound terminal-state notification delivery without dropping terminal events [seatunnel]
DanielLeens opened a new issue, #12118:
URL: https://github.com/apache/seatunnel/issues/12118
## Description
This is a focused task for the worker-to-master terminal-state notification path. It is not a regression report.
Verified at `dev` commit `97d461bc0773399d632fd078735736ecd44f5f0b`:
- `TaskExecutionService.notifyTaskStatusToMaster` (`TaskExecutionService.java:702-706`): the Javadoc (`:695-701`) states it "retries indefinitely until successful or the service is shutdown"; the loop is `while (isRunning && !notifyStateSuccess)` with a fixed `sleepTime = 1000`; it exits on success, `JobNotFoundException`, or service shutdown, and the `JobRestoreInProgressException` branch explicitly asks the worker to keep retrying.
- One asynchronous completion callback is issued per task-group execution (`:605-606`), not per intermediate state transition.
- The delivered `TaskExecutionState` carries the terminal `executionState` and `throwableMsg`. The master's `IMap` does not contain an undelivered terminal event, so this RPC is the only carrier of that fact.
Impact: while the master is unreachable (partition, slow election), every completed task group parks one worker thread in this loop; combined with the unbounded worker pool, thread count grows with completions rather than with running work.
Constraint: the terminal fact must never be abandoned. A temporary RPC interruption recovers without any master switch, and dropping the notification would remove the event needed for normal terminal-state convergence.
## Expected outcome
- Retain pending terminal events (a small local outbox) instead of holding a thread per event.
- Bound delivery concurrency and per-cycle attempts with backoff; do not let a single drain thread block indefinitely on one RPC.
- Any give-up requires an authoritative acknowledgement or an explicit, implemented, and tested master-pull reconciliation protocol.
- Test: block the notify RPC to the master, assert a bounded worker thread count, then unblock and assert every terminal state is delivered exactly once.
--
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: commits-unsubscribe@seatunnel.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Improve][Zeta] Bound terminal-state notification delivery without dropping terminal events [seatunnel]
Posted by "CryoThrust (via GitHub)" <gi...@apache.org>.
CryoThrust commented on issue #12118:
URL: https://github.com/apache/seatunnel/issues/12118#issuecomment-5556404113
A few contract points may help make the outbox design implementable without weakening the “never abandon a terminal fact” requirement:
1. Give every terminal event a stable identity such as `(jobId, taskGroupId, executionAttempt)` and make the master-side apply idempotent. A retry after an ambiguous RPC result must be safe, and a duplicate from before/after master failover must receive an acknowledgement rather than create a second transition.
2. Persist/enqueue the event before releasing the task completion callback. The dispatcher should be the only component that performs RPCs; completion threads should publish to the outbox and return, so a blocked master cannot consume one thread per event.
3. “Bounded outbox” and “never drop” need an explicit overflow policy. A bounded in-memory queue alone cannot satisfy both when the master is unavailable indefinitely. Either spill to a durable local store, or apply backpressure to completion publication and document the liveness trade-off; silently evicting the oldest terminal event is not safe.
4. Use a monotonic per-event state (`PENDING -> IN_FLIGHT -> ACKED`) and treat `JobNotFoundException` as an explicit terminal acknowledgement only when the master contract says the job is irrecoverable. Other failures, including an election/restore response, should return the event to `PENDING` with bounded exponential backoff and jitter.
5. Add tests for duplicate delivery, an ambiguous timeout after master acceptance, active-master handover while an event is in flight, and outbox overflow. The assertion should be that each terminal identity is applied at most once and eventually acknowledged when the master becomes reachable.
This keeps the implementation transport-independent and makes the “exactly once” property an idempotent state-application contract rather than an assumption about the RPC transport.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Improve][Zeta] Bound terminal-state notification delivery without dropping terminal events [seatunnel]
Posted by "yigitcan-ozturk (via GitHub)" <gi...@apache.org>.
yigitcan-ozturk commented on issue #12118:
URL: https://github.com/apache/seatunnel/issues/12118#issuecomment-5572965688
Hi, I'd like to work on this issue. I plan to keep the first implementation focused on the worker-side terminal-state delivery path: decouple completion callbacks from RPC retry by enqueueing terminal events into a local outbox, bound dispatcher concurrency/attempts with backoff, and preserve the existing terminal-state convergence contract without dropping events.
Before implementation, I'll trace the current master-side apply semantics and failover behavior to determine the smallest safe event identity/idempotency boundary, then add focused tests that block the notify RPC, verify bounded worker-thread growth, restore connectivity, and verify eventual terminal-state delivery. I won't broaden the scope into unrelated worker-pool or recovery changes.
I checked the current issue/PR set and did not find an active PR for #12118. Please let me know if this scope is available.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org