zhangshenghang commented on PR #13335:
URL: https://github.com/apache/seatunnel/pull/13335#issuecomment-7231045689
@DanielLeens — agreed on both halves: bounding the wait on the pipeline
state-machine thread is the right fix, but completing CANCELED while the worker
is still a member and never received `CancelTaskOperation` is not proof of
cancellation. Here is the split I will implement in this PR.
1. Keep the bounded synchronous wait, but stop conflating "wait is bounded"
with "cancellation done". On exhaustion of `CANCEL_NOTICE_ATTEMPTS`:
- if `nodeEngine.getClusterService().getMember(executionAddress) ==
null`, the execution no longer exists, so completing CANCELED locally stays
valid (this is the pre-existing member-gone branch);
- if the member is alive, the vertex stays CANCELING. No
`updateTaskState(CANCELED)`, no terminal `taskFuture`, so no slot release or
recovery can start.
2. Continue delivery off the state-machine thread instead of lying about the
outcome. `PhysicalVertex` already holds `jobMaster`, so the retry runs on
`jobMaster.getExecutorService()` and re-sends `CancelTaskOperation` until one
of: the send succeeds (the worker's terminal callback then drives CANCELED
through the normal path), the member leaves the cluster (the execution is gone,
local CANCELED becomes valid), or the attempt is superseded (the vertex left
CANCELING or `currentExecutionId` changed). The last condition is why I want to
do this together with the executionId work in #13339 rather than inventing a
second attempt token here.
Tests I will add: three failed sends with an alive member -> state remains
CANCELING, `taskFuture` not completed, slot still owned; async delivery
succeeds afterwards -> the acknowledgement drives CANCELED; member leaves ->
local CANCELED allowed; superseded attempt -> retry stops without touching
state.
On the stronger option (execution-generation lease revoked by the worker
before replacement): I agree it is the real fence, but it changes the
master/worker protocol and overlaps #13338/#13339, so I would rather land this
bounded-delivery correction first and treat the lease as one design covering
all three PRs. If you prefer that I hold this PR until the lease exists, say so
and I will park it instead of pushing the smaller change.
--
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]