imRYiUK opened a new pull request, #13334:
URL: https://github.com/apache/seatunnel/pull/13334

   Yes, I am contributing to Apache SeaTunnel.
   
   ### Purpose of this pull request
   
   Closes #13320.
   
   During master failover, `PhysicalVertex.initStateFuture` probes every 
`RUNNING`/`DEPLOYING` vertex with `checkTaskGroupIsExecuting` and moves the 
vertex to `FAILING` when it returns `false`. That method returned `false` both 
for a definitive "not executing" answer and when the 
`CheckTaskGroupIsExecutingOperation` invocation itself failed 
(`ExecutionException` / `InterruptedException`: network blip, GC pause, busy 
worker, membership still settling). A single transient failure therefore failed 
a healthy task and forced a full pipeline restore.
   
   This change distinguishes "the probe failed" from "the worker said no":
   
   - A failed invocation (`ExecutionException`) is retried, 3 attempts in 
total, 1s apart, before it is treated as "not executing".
   - A worker that is no longer a cluster member, or a definitive `false` from 
the worker, still fails the vertex immediately and is not retried. Membership 
is re-checked on every attempt.
   - If every attempt fails the result stays `false`, so the existing fallback 
(restore the pipeline) is unchanged.
   - An `InterruptedException` stops the retries, restores the thread's 
interrupt flag and returns `false`.
   
   The probe itself moved into a small package-private method 
(`probeTaskGroupIsExecuting`) and the retry logic into 
`checkWorkerIsExecuting`, so both can be tested without a cluster. No public 
API, configuration or data format changes. The retry count and interval are 
constants (`CHECK_TASK_GROUP_EXECUTING_ATTEMPTS`, 
`CHECK_TASK_GROUP_EXECUTING_RETRY_SLEEP_MILLIS`) rather than new settings; 
happy to make them configurable if reviewers prefer.
   
   Trade-off: when a worker is truly unreachable, the probe can now take up to 
3x the invocation timeout per vertex before failing it.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No API or configuration change. Behavior during master failover: a transient 
failure of the liveness probe no longer fails a running task and triggers a 
pipeline restore (checkpoint replay / source re-read). A genuinely dead or 
departed worker is still detected as before.
   
   ### How was this patch tested?
   
   Four unit tests were added to `PhysicalVertexTest` (JDK 11):
   
   - transient `ExecutionException` followed by `true` is retried and returns 
`true` (2 probe calls)
   - a definitive `false` is not retried (1 probe call)
   - a probe that keeps failing is given up after 
`CHECK_TASK_GROUP_EXECUTING_ATTEMPTS` attempts and returns `false`
   - an `InterruptedException` stops after one attempt, returns `false` and 
keeps the interrupt flag
   
   ```bash
   ./mvnw -pl seatunnel-engine/seatunnel-engine-server -am package \
     -Dtest=PhysicalVertexTest -Dsurefire.failIfNoSpecifiedTests=false
   ```
   
   `PhysicalVertexTest`: 10 tests, 0 failures (6 existing, 4 new). `spotless` 
check passes. I did not run the full engine test suite or an end-to-end 
failover test.
   
   ### Check list
   
   * [ ] If any new Jar binary package adding in your PR, please add License 
Notice according
     [New License 
Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md)
 (not applicable, no new dependencies)
   * [ ] If necessary, please update the documentation to describe the new 
feature. (not applicable)
   * [ ] If necessary, please update `incompatible-changes.md` to describe the 
incompatibility caused by this PR. (not applicable)
   


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