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/14 13:12:31 UTC

[PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

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

   ## Purpose
   
   Fixes a real, recurring `engine-v2-it (8, ubuntu-latest)` failure that currently hits `dev` itself and many unrelated PRs:
   
   ```
   SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck:448
     -> assertEventuallyCanceled:556
     org.opentest4j.AssertionFailedError: expected: <CANCELED> but was: <FAILED>
   ```
   
   On `dev`'s own push CI this leg has failed on every completed run since 2026-09-13 04:01Z (5 in a row: runs 34736904718, 34747735985, 34752507232, 34761938725, 34801745423) and intermittently before that since the test landed in #12030 — roughly a 70% failure rate, with the JDK 11 leg usually passing. The test is right about the intended semantics; the engine does not currently guarantee them in one specific window.
   
   ## Root cause
   
   A user cancels a streaming job while its worker dies. `PhysicalVertex#noticeTaskExecutionServiceCancel` sends `CancelTaskOperation` to the worker and, if the member leaves *before* acking, falls back to marking the vertex `CANCELED` locally (the #10729 fix). But the ack is immediate: `TaskExecutionService#cancelTaskGroup` just calls `cancellationFuture.cancel(false)` and returns, and the vertex's terminal state only arrives later through the task's own completion callback (`notifyTaskStatusToMaster`). So if the worker dies *after* acking but before that callback:
   
   1. `noticeTaskExecutionServiceCancel` has already returned normally at the `.invoke().get()` success path, leaving the vertex `CANCELING` and waiting for a callback that will never come (worker log: `Interrupted task 1000100000000` … then `notifyTaskStatusToMaster` → `NullPointerException: Target cannot be null!` because the worker's own cluster service is already gone).
   2. Hazelcast fires `memberRemoved` → `CoordinatorService#failedTaskOnMemberRemoved` → `makeTasksFailed`, which explicitly matches `CANCELING` vertices and marked them `FAILED` with "The taskGroup(...) deployed node(...) offline".
   3. `SubPlan#getPipelineEndState` sees `failedTaskNum > 0` → pipeline `FAILED` → `PhysicalPlan` → job `FAILED`.
   
   Which side of the ack the worker shutdown lands on is pure scheduling timing, so the same test passes or fails run to run. Verified end to end against `dev` run 34801745423's job log: the enumerator vertex (taskGroupId=1) went `FAILED` through exactly this `failedTaskOnMemberRemoved` stack, while the two reader vertices that were still inside the un-acked retry loop resolved `CANCELED` via the #10729 fallback and then rejected the later `FAILED` attempt ("Task is trying to leave terminal state CANCELED").
   
   The test's Javadoc argued `failedTaskOnMemberRemoved` "cannot be the one to save this race" because the cancel chain holds the vertex lock; that is true only for the un-acked window and was the gap.
   
   ## Fix
   
   `CoordinatorService#makeTasksFailed` now resolves a lost vertex that is already `CANCELING` to `CANCELED` instead of `FAILED`, keeping the same "node offline" message for diagnostics. `DEPLOYING`/`RUNNING` vertices still resolve to `FAILED` (their work was genuinely cut short); all other states are left untouched, exactly as before. The decision is extracted into a small package-private `resolveLostMemberState(ExecutionState)` so it is unit-testable without a cluster.
   
   Why this is the right place rather than the test: a cancel was requested for the vertex and the worker acknowledged it; the member loss only removed the terminal callback. Resolving it as `CANCELED` keeps the outcome the cancel request was going to produce anyway, and matches what a clean cancel yields. Marking it `FAILED` reported a user-cancelled job as failed purely because a worker went away while honoring the cancel.
   
   **Scope of the behavior change** (checked against the callers):
   - User cancel + worker loss mid-cancel: job ends `CANCELED` (was: `FAILED`). This is the only observable change.
   - Restore is unaffected: a job in `CANCELING` has already called `JobMaster#neverNeedRestore()` (`PhysicalPlan#stateProcess` CANCELING/FAILING branch), and a `FAILING` pipeline that cancels its sibling tasks already has `failedTaskNum > 0` from the original failure, so it still ends `FAILED`.
   - No checkpoint, serialization, config, or API surface is touched.
   
   The E2E test's Javadoc is corrected to describe both mechanisms (un-acked → #10729 fallback; acked-then-lost → this path); its assertion is unchanged and remains the integration guard.
   
   ## Tests
   
   - New `CoordinatorServiceLostMemberResolutionTest` (pure unit test, no Hazelcast): `CANCELING → CANCELED`, `DEPLOYING`/`RUNNING → FAILED`, every other state (and `null`) → untouched.
   - Existing `SplitClusterFaultToleranceIT#testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` becomes deterministic for the scenario it targets; its assertion is not relaxed.
   
   Per this repository's contribution guidance for Apache SeaTunnel, local execution was limited to `spotless:apply`/`spotless:check`; compilation and the tests above are verified by this PR's own GitHub Actions CI.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-6033681452

   Thanks @SEZ9. The comment was not cut off on my side; the matrix is the one in `CoordinatorServiceLostMemberResolutionTest` on `f85d43600df`, spelled out here:
   
   | Job status | `CANCELING` vertex | `DEPLOYING` vertex | `RUNNING` vertex |
   |---|---|---|---|
   | `CANCELING` | `CANCELED` | `CANCELED` | `CANCELED` |
   | any other `JobStatus` (e.g. `RUNNING`, `FAILING`, `FAILED`; iterated over the complement of `CANCELING`) | `FAILED` | `FAILED` | `FAILED` |
   | missing (`null`) | `FAILED` | `FAILED` | `FAILED` |
   
   Skipped states: every vertex state other than those three (`CREATED`, `SCHEDULED`, `INITIALIZING`, `CANCELED`, `FAILED`, `FINISHED`, and so on) returns `Optional.empty()` for every `JobStatus`, and a `null` vertex state returns empty too. The tests are `cancelingVertexOfUserCancelledJobResolvesToCanceled`, `notYetCancelledVerticesOfUserCancelledJobResolveToCanceled`, `engineInitiatedCancelStillResolvesToFailed` (the negative case you asked about), `deployingAndRunningVerticesStillResolveToFailed` and `otherStatesAreLeftUntouched`.
   
   CI status, so there is no ambiguity: fork run 37337325279 on this head did not run any tests. Its `Dead links` job failed on HTTP 429 from `deepwiki.com` (README badge links), and every test job was skipped behind that gate. So there is currently no test result for this head, including `SplitClusterFaultToleranceIT`. A rerun would hit the same 429 (I checked just now, deepwiki still answers 429); the fix is #12639, which is open and waiting for review. I will re-run this head once that lands and post the result here.
   


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-5846320065

   Thanks for the thorough re-trace — I went back through `CoordinatorService`, `SubPlan`, and the addPhysicalVertexCallBack path against `ca60502` and Issues 1, 2, 3, and 4 all hold up; I'm not going to relitigate them.
   
   **Issue 1 (master-failover CANCELING treated as a user cancel):** Conceding this one fully. `resolveLostMemberState` only sees `ExecutionState`, and `restorePipelineState` reaches `PipelineStatus.CANCELING` without ever going through a user cancel or `neverNeedRestore`. Once restore is exhausted that path now ends CANCELED with the reason dropped, where it used to end FAILED with "node offline" — that's a real regression in what the job reports, not just a cosmetic gap. Your suggestion to gate on `jobMaster.getPhysicalPlan().getJobStatus() == JobStatus.CANCELING` is the right shape; `failedTaskOnMemberRemoved` already has `jobMaster` in scope so it's a cheap parameter to thread through.
   
   **Issue 2 (sibling vertices not yet reached by the cancel loop):** Also conceding. `SubPlan#stateProcess` cancels coordinator vertices before reader vertices, sequentially, each holding its own vertex lock through the un-timed RPC — so at the exact moment `memberRemoved` fires, a vertex the loop hasn't reached is still RUNNING, and `resolveLostMemberState` still fails it. This PR closes the "already-CANCELING" half of the window, not the whole thing. goutamadwant's 0/20 local result is encouraging but doesn't contradict you — it just means the loop is fast enough on a synthetic single-worker fixture that it usually wins the race, not that the race is gone. I agree with checking pipeline status instead of only vertex state: I'll change the resolver to take the owning `SubPlan`'s `PipelineStatus` (or thread the job-status flag from Issue 1 through the same call) so DEPLOYING/RUNNING vertices under an already-CANCELING pipeline also resolve CANCELED, while a genuinely FAILING pip
 eline still fails them. On the unsynchronized-read point: agreed it's a real TOCTOU, and while the plain read predates this PR, I'll fold the read-and-decide into a single synchronized path on `PhysicalVertex` while I'm touching this anyway, rather than leaving it as a separate follow-up.
   
   **Issue 3 (dropped node-offline reason on the CANCELED branch):** Agreed — I'll add a WARN in `makeTasksFailed` for the resolution it applies (task group, lost address, resolved state), symmetric with the WARN `noticeTaskExecutionServiceCancel` already emits for the pre-ack fallback, so a member-loss-driven cancel is distinguishable from a clean one in the logs.
   
   **Issue 4 (Javadoc's restore rationale):** Agreed, the guard that actually keeps a no-task-failure FAILING pipeline ending FAILED is `getPipelineEndState`'s explicit `PipelineStatus.FAILING` check, not `failedTaskNum`. I'll reword that sentence to name the real guard instead of implying the count is what saves it.
   
   **Issue 5 (naming/`null` sentinel on the private helper) and Issue 6 (`failedTaskOnMemberRemoved` name/Javadoc):** Both fair. Since I'm already reworking `resolveLostMemberState`'s signature for Issues 1 and 2, I'll take the opportunity to rename it and make the "leave the vertex alone" case explicit (`Optional` or a small enum) rather than an unlabeled `null`. For the public entry point I'll add the one-line Javadoc noting the CANCELING→CANCELED branch rather than renaming it — it's cited by name from five IT Javadocs and a rename would be pure churn for no behavior change.
   
   **Issue 7 (IT Javadoc overstating the guarantee):** Conceding the wording is too strong today — it currently only holds for the vertex that's already CANCELING, exactly as you traced through `awaitAnyVertexCanceling` and the sequential cancel order. I'll scope it down for now, and once the Issue 1/2 pipeline-status gate lands, the stronger wording will actually be true for the whole pipeline rather than just the first-cancelled vertex, so I'd rather fix the guarantee itself than just soften the sentence permanently.
   
   I'll push a revision covering all seven points together rather than trickling out partial commits, and will flag this thread again once it's up so the CANCELING/CANCELED mapping can get a fresh look against the new diff. Thanks for the rigor here — Issues 1 and 2 in particular were real gaps I'd missed.


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-5846319915

   Thanks for running this under real load — that table is exactly the evidence I wanted to see. 12/20 and 4/10 baseline failures collapsing to 0/20 and 0/10 with the fix, both against the same `dev` base commit, confirms the fix closes the specific race the flake was hitting, and your restore/failure-reporting sweep across the checkpoint-error and sibling-failure paths matches my own trace.
   
   One thing to flag before you take this as the full picture: SEZ9 just posted a review on the same head that found two real edge cases your local run wouldn't have exercised — a master-failover-initiated cancel (`SubPlan#restorePipelineState`) that isn't a user cancel but now resolves CANCELED the same way, and a sibling vertex the sequential cancel loop hasn't reached yet (still RUNNING) that can still flip the job to FAILED. Both are timing-dependent in the same way the original flake was, so a clean 0/20 on a single-worker synthetic run doesn't rule them out. I'm going to fold a pipeline/job-status-aware version of the resolver into the next revision to close those too — I'll ping this thread again once that's up so you can point your loop at it.


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-6138731403

   @SEZ9 Here are the exact pointers you requested against the current head `65ef1bde182`:
   
   - **F1 / job-status gate:** `CoordinatorService.resolveLostMemberState` at `CoordinatorService.java:2234-2249` returns `CANCELED` only when `JobStatus.CANCELING`; `CANCELING`, `DEPLOYING`, and `RUNNING` resolve to `FAILED` for every other or missing job status. The negative matrix is in `CoordinatorServiceLostMemberResolutionTest#engineInitiatedCancelStillResolvesToFailed` (`:81-91`) and `#deployingAndRunningVerticesStillResolveToFailed` (`:94-111`).
   - **F2 / siblings and locking:** `#notYetCancelledVerticesOfUserCancelledJobResolveToCanceled` is at `CoordinatorServiceLostMemberResolutionTest.java:63-73`. The production read, decision, and transition are all inside `synchronized (physicalVertex)` at `CoordinatorService.java:2153-2191`; the job status is read per vertex inside that monitor.
   - **F3 / node-offline observability:** the member-loss-completed cancel emits a WARN with task group, lost address, job status, previous state, and resolved state at `CoordinatorService.java:2168-2181`.
   - **F4 / restore rationale:** the resolver Javadoc at `CoordinatorService.java:2221-2227` explicitly names `SubPlan#getPipelineEndState`'s `FAILING` pipeline-state check as the reason a no-task-failure failing pipeline still ends `FAILED`.
   - **F5 / F6:** the private worker is named `resolveTasksOnLostMember` (`:2140`), the helper returns `Optional<ExecutionState>`, and its Javadoc documents `Optional.empty()` as “leave the vertex alone” (`:2229-2233`). The public `failedTaskOnMemberRemoved` Javadoc (`:2110-2118`) explicitly states that the method may resolve a vertex to `CANCELED` despite its historical name.
   - **F7 / IT guarantee:** `SplitClusterFaultToleranceIT.java:363-372` now covers both the already-`CANCELING` vertex and still-`RUNNING` siblings, while separately stating that engine-initiated cancellation remains `FAILED`.
   
   CI update: I retried only the failed `changes` job in fork run https://github.com/DanielLeens/seatunnel/actions/runs/37762860404 after confirming its prior failure was the Maven Wrapper 3.1.0 download receiving HTTP 404 and that the same URL now returns HTTP 200. Attempt 2 is currently in progress. No source change was needed for that CI failure; I will not represent the tests as passed until the rerun actually reaches and completes them.
   


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-6624354746

   Thanks @SEZ9. Answers against the unchanged head `65ef1bde182`, point by point.
   
   **F1, master-failover reschedule.** Here is the trace:
   - `JobMaster#getJobStatus` (`JobMaster.java:1099-1101`) delegates to `PhysicalPlan#getJobStatus` (`PhysicalPlan.java:355-357`), which reads `runningJobStateIMap.get(jobId)`. That is the persisted job status, not a pipeline status.
   - `SubPlan#restorePipelineState` (`SubPlan.java:565-581`) restores the vertex states and then calls `updatePipelineState(PipelineStatus.CANCELING)` for a pipeline that was not yet RUNNING. It changes only the pipeline state. It never writes the job status.
   - So when the new master cancels tasks after a failover, the job status is whatever was persisted before the switch, normally RUNNING. `resolveLostMemberState` (`CoordinatorService.java:2234-2249`) returns CANCELED only for `JobStatus.CANCELING`, so those vertices resolve to FAILED, as they did before this PR. The job status would only be CANCELING if the user had already cancelled the job before the failover, and in that case CANCELED is the correct outcome.
   
   Test coverage: `CoordinatorServiceLostMemberResolutionTest#engineInitiatedCancelStillResolvesToFailed` (`:81-92`) asserts FAILED for a CANCELING vertex under every job status except CANCELING, and under `null`. To be precise, no IT combines a master switch with a worker loss and asserts the end state. I'm not adding one in this PR, for two reasons. The resolver's only new input is the job status, and the trace above shows restore never sets it. Also, what the engine does after a vertex FAILS (restore and reschedule, or ending FAILED) is the existing path, which this PR does not change.
   
   **F2, CANCELING plus RUNNING sibling on the lost member.** `testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` runs `pending_jobs_streaming_lifecycle.conf` (FakeSource `parallelism = 2`) on a single worker, so the lost member hosts every task vertex. It shuts the worker down as soon as the first vertex is seen CANCELING (`SplitClusterFaultToleranceIT.java:443-454`). Because `SubPlan` cancels sequentially, the second vertex is normally still RUNNING at that moment. The IT does not assert that, though, because it depends on timing. The deterministic sibling case is pinned by `#notYetCancelledVerticesOfUserCancelledJobResolveToCanceled` (`:63-73`). I'll add a Javadoc note to the IT that states exactly this split.
   
   **F3, WARN identifiers.** These are already in the message. The WARN at `CoordinatorService.java:2171-2181` prints the `TaskGroupLocation`, and its `toString` (`TaskGroupLocation.java:73-82`) is `jobId=..., pipelineId=..., taskGroupId=...`. The message also includes the lost member address, the job status, the previous vertex state and the resolved state.
   
   **F4, restore Javadoc.** Already on this head: `CoordinatorService.java:2221-2227` says a pipeline that went FAILING without a failed task still ends FAILED, because `SubPlan#getPipelineEndState` checks the FAILING pipeline status.
   
   **F5/F6, naming.** The public `failedTaskOnMemberRemoved` Javadoc (`CoordinatorService.java:2111-2118`) already says that despite its name it can resolve a vertex to CANCELED. The only IT Javadoc that names it (`SplitClusterFaultToleranceIT.java:358-370`) describes both the CANCELED branch and the FAILED branch. I'm keeping the method name to avoid churn in a public entry point.
   
   **F7, guarantee wording.** Fair. Line 367 says the job "is cancelled by the user", which is the intent, not the condition the code checks. In the follow-up commit I'll reword it to say the CANCELED outcome holds because the job status is CANCELING when the member-removed event is processed, and that the same condition covers the RUNNING siblings.
   
   Follow-up commit (Javadoc only, no production change): the F7 rewording and the F2 sibling-shape note, both in the `testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` Javadoc.


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-5862478155

   Thanks for the fix, and thanks @davidzollo for the detailed verification. Before merging, a few points from my earlier review are still open:
   
   1. **Engine-initiated cancel.** `CANCELING` is not only user-initiated: `SubPlan#restorePipelineState` also cancels tasks during a master-failover reschedule. With this change, a job the user never cancelled can end as `CANCELED` with no error reason instead of `FAILED`. Could you either distinguish the two cancel origins in `resolveLostMemberState`, or explain why that path cannot reach `makeTasksFailed` with a `CANCELING` vertex?
   
   2. **Sibling vertices still `RUNNING`.** The resolution consults only the vertex state, and reads it outside the vertex lock. Vertices on the lost worker that the sequential cancel loop has not reached yet are still `RUNNING`, so they resolve to `FAILED` and flip the user-cancelled job to `FAILED` anyway. Please consider consulting the pipeline/job state (and taking the lock) so the fix covers the whole pipeline rather than only vertices that already entered `CANCELING`.
   
   3. **IT Javadoc guarantee.** Related to the above: "Either way the vertex reaches CANCELED ... regardless of which side of the ack" only holds for vertices already in `CANCELING`. Please tighten the wording, or make it true via point 2.
   
   4. **Dropped "node offline" reason.** The reason attached to a `CANCELED` resolution is never logged, and `SubPlan` only records throwable messages for `FAILED` tasks. A log line at the resolution site would let operators tell a member-loss cancel from a clean cancel.
   
   5. **Javadoc restore argument.** Please note that a pipeline that turned `FAILING` without any task failure has `failedTaskNum == 0` and stays `FAILED` only because `SubPlan#getPipelineEndState` checks the `FAILING` pipeline state.
   
   6. **Naming.** `makeTasksFailed` and the public `failedTaskOnMemberRemoved` now also resolve vertices to `CANCELED`, and `resolveLostMemberState` uses `null` to mean "skip". A rename, a short Javadoc for the null contract, and updating the IT Javadocs that cite the old name would make the branching harder to misread.
   
   Points 1 and 2 are the ones I'd like addressed (or argued away) before merge; the rest are small follow-ups that can land in the same PR.
   
   <!-- streview-comment:1372 -->


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-6057765161

   Thanks @SEZ9. Status update on the CI blocker: the dead-link fix (#12639) is now on dev, and I have merged current dev into this branch (new head `65ef1bde182`, behind dev by 0). The fork Build will run on that head, so `SplitClusterFaultToleranceIT` and `CoordinatorServiceLostMemberResolutionTest` should finally execute. I will ping here with the results once it completes, and I will answer the F1-F7 pointers against the exact lines in the same message so you can check them against the diff and the green run together.


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-5998161764

   @SEZ9 The revision I owed you is up: `f85d43600df`. It covers the points from your review and your follow-up. Point by point:
   
   1. **Engine-initiated cancel.** `resolveLostMemberState` now takes the job status as well as the vertex state, and a vertex only resolves to `CANCELED` while the job itself is `JobStatus.CANCELING` (set by `PhysicalPlan#cancelJob` / `#stopJob`). In every other job status a `CANCELING` vertex resolves to `FAILED` again, as on `dev`. That covers `SubPlan#restorePipelineState` after a master switch, `SubPlan#handleCheckpointError`, and a `FAILING` pipeline or job cancelling its siblings, so a job the user never cancelled cannot end `CANCELED` with the reason dropped.
   
   2. **Sibling vertices still `RUNNING`.** While the job is `CANCELING`, `DEPLOYING` and `RUNNING` vertices on the lost member now resolve to `CANCELED` too, so the vertices the sequential cancel loop has not reached yet no longer flip the job to `FAILED`. I used the job status rather than the pipeline status because the pipeline status cannot tell a user cancel from an engine cancel (point 1). The state read, the decision and the transition now run inside `synchronized (physicalVertex)`, the same monitor `updateTaskState`, `cancel` and `stateProcess` use, and the job status is read per vertex inside that block.
   
   3. **IT Javadoc.** Reworded to state what is now true: every vertex of the user-cancelled job that is still deployed on the lost worker reaches `CANCELED`, and an engine-cancelled vertex keeps resolving to `FAILED`.
   
   4. **Dropped reason.** `resolveTasksOnLostMember` logs a WARN with the task group, the lost address, the job status and the previous state whenever a member loss completes a cancel.
   
   5. **Restore argument.** The Javadoc now names the real guard: a pipeline that turned `FAILING` without a failed task stays `FAILED` because `SubPlan#getPipelineEndState` checks the `FAILING` pipeline status, not because of `failedTaskNum`.
   
   6. **Naming.** The private `makeTasksFailed` is now `resolveTasksOnLostMember`, and `resolveLostMemberState` returns `Optional<ExecutionState>` instead of a `null` sentinel. I kept the public `failedTaskOnMemberRemoved` name and gave it a Javadoc that says it can also resolve to `CANCELED`; the other IT Javadocs that cite it describe the non-cancelled `FAILED` path, which is unchanged, so I left them alone.
   
   `CoordinatorServiceLostMemberResolutionTest` now pins the whole matrix: `CANCELING`/`DEPLOYING`/`RUNNING` under a `CANCELING` job resolve to `CANCELED`, the same three states under every other job status (and a missing one) resolve to `FAILED`, and all other vertex states are left alone.
   
   One limit to be clear about: the unit test covers the decision, not the locking. The end-to-end behaviour is exercised by `SplitClusterFaultToleranceIT#testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` in `engine-v2-it`. I have not compiled or run anything locally beyond `spotless:apply`, so CI on this head is the verification; I will post the result once it has run. @davidzollo your approval was on the previous head, so this needs a fresh look as well.
   


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-6594367678

   @SEZ9 the re-run you asked for is green on the unchanged head `65ef1bde182`: fork run https://github.com/DanielLeens/seatunnel/actions/runs/37762860404 (attempt 3) succeeded. `SplitClusterFaultToleranceIT` ran 11 tests with 0 failures on both engine-v2-it JDK 8 and JDK 11, and `CoordinatorServiceLostMemberResolutionTest` passed 5/5 in the unit-test job.
   
   The Apache-side Build check still shows the 10-13 attempt-2 failure only because the status sync scans PRs updated within the last 7 days; this comment should let it refresh. Could you take another look?
   


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-5675955910

   CI status note for the fork run on head `ca60502`: `SplitClusterFaultToleranceIT` (the test this PR fixes) passed on both JDK legs. The three red jobs are the three dev-level failures that are red on `dev` itself and have their own fix PRs, none related to this change:
   
   - `engine-v2-it (8)`: `BackpressureSlowSinkIT#testCheckpointsKeepCompletingUnderSustainedBackpressure`, checkpoint barrier starved behind the source's checkpoint lock; engine fix in #12316, fixture fix in #12313.
   - `engine-v2-it (11)`: `CheckpointCoordinatorFailoverIT#testStreamJobFailsAfterCheckpointTriggerDispatchFailure`, the trigger-dispatch vs notify-complete race; fix in #12288.
   - `all-connectors-it-2 (8)`: `OpengaussCDCIT#testAddFieldWithRestore`, restored schema dropping a column added while the job was stopped (regression from #11503); fix in #12321.
   
   I will re-run the failed jobs once those land rather than burn reruns against known-red tests.
   


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-6008991117

   Thanks for the detailed point-by-point write-up on `f85d43600df`. The approach you describe lines up with what I was after on each of the earlier points: gating the `CANCELED` resolution on `JobStatus.CANCELING` rather than the vertex state alone, resolving `DEPLOYING`/`RUNNING` siblings while the job is `CANCELING`, doing the read, decision and transition inside `synchronized (physicalVertex)`, the WARN on a member-loss-completed cancel, naming `SubPlan#getPipelineEndState` as the real guard in the restore Javadoc, the `resolveTasksOnLostMember` rename with `Optional<ExecutionState>`, and the reworded IT guarantee. I haven't inspected the revision itself yet, so I'll confirm each of these against the code rather than close them here.
   
   One ask in the meantime: your comment appears cut off at "`CANCELING`/`DEPLOYING`/`RUNNING` under a `CANCELING` jo…". Could you post the rest of the matrix that `CoordinatorServiceLostMemberResolutionTest` pins? In particular I'd like to see that it covers the negative cases — a `CANCELING` vertex under a non-`CANCELING` job status (e.g. `RUNNING`, `FAILING`) resolving to `FAILED` — and which states are expected to be skipped.
   
   Once I have the full matrix I'll do a pass over the revision.
   
   <!-- streview-comment:1554 -->


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-6051307423

   Thanks for spelling the matrix out. That is the behaviour I was hoping for on PR12311-F1 and PR12311-F2, but before I mark either resolved I need to see it in the diff on `f85d43600df`. Could you point me at the change in `resolveLostMemberState` that keys the resolution on the job status, and at `engineInitiatedCancelStillResolvesToFailed` and `notYetCancelledVerticesOfUserCancelledJobResolveToCanceled` in `CoordinatorServiceLostMemberResolutionTest`? For F2, please also confirm whether the job-status/vertex-state read now happens under the vertex lock, or explain why the window between the read and the resolution is benign.
   
   On the lower-severity items:
   
   - **F3** – is the "node offline" reason now logged or recorded anywhere when a vertex resolves to `CANCELED` via member loss? A single log line would be enough.
   - **F4** – has the restore Javadoc been updated to mention that a `FAILING` pipeline with `failedTaskNum == 0` stays `FAILED` only because of the `FAILING` pipeline-state check in `SubPlan#getPipelineEndState`?
   - **F5 / F6** – `makeTasksFailed` and `failedTaskOnMemberRemoved` now also resolve vertices to `CANCELED`; a rename, or at minimum a Javadoc note on the `Optional.empty()`-means-skip contract of `resolveLostMemberState`, would help, and the IT Javadocs that cite `failedTaskOnMemberRemoved` by name need the same touch.
   - **F7** – if resolution is now job-status based, the "regardless of which side of the ack" wording in `SplitClusterFaultToleranceIT` may now hold for `RUNNING` siblings too; please confirm whether that Javadoc was revisited, or point me at the current wording.
   
   On CI: understood that run 37337325279 produced no test results because the `Dead links` job failed on the `deepwiki.com` 429 and the test jobs were skipped behind it. I will hold off merging until there is a green run of `SplitClusterFaultToleranceIT` and `CoordinatorServiceLostMemberResolutionTest` on this head; please ping here once it has been re-run.
   
   <!-- streview-comment:1597 -->


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "SEZ9 (via GitHub) via commits" <co...@seatunnel.apache.org>.
SEZ9 commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-6621577126

   Thanks for the re-review pass on `65ef1bde182c8ef9e0f8f0da03e2c29fc7517a42`. Resolving the lost member's vertices based on the job status rather than the per-vertex state, with the read under the vertex monitor, addresses the core of what was flagged on `ca60502b9e`. Going through the earlier points against this head:
   
   **F1 (engine-initiated CANCELING → CANCELED):** Gating on the job status should keep a master-failover reschedule out of the CANCELED branch, but I'd like that confirmed rather than assumed. Could you walk through what `JobMaster#getJobStatus` returns while `SubPlan#restorePipelineState` is cancelling tasks after a master failover, and point to the test (new or existing) that exercises that path and asserts the job is rescheduled / ends FAILED rather than CANCELED?
   
   **F2 (RUNNING siblings, read outside the lock):** Using the job status means siblings the sequential cancel loop hasn't reached yet resolve to CANCELED too, and the read now happens under `synchronized (physicalVertex)` — good. One remaining ask: is there a test where the lost member hosts both a CANCELING vertex and a still-RUNNING vertex, asserting the final job state is CANCELED? If `testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` already covers that shape, a short note in its Javadoc is enough.
   
   **F3 (dropped "node offline" reason):** The WARN when member loss completes a cancel covers this. Please make sure it includes the job id, pipeline id, task group / vertex id and the removed member address so operators can correlate it.
   
   **F4 (Javadoc restore argument):** Please update the restore Javadoc to state that a pipeline that went FAILING with `failedTaskNum == 0` stays FAILED because `SubPlan#getPipelineEndState` checks the FAILING pipeline state, not the failed-task count.
   
   **F5 / F6 (naming):** `resolveTasksOnLostMember` plus `Optional<ExecutionState>` from `resolveLostMemberState` reads much better than the `null`-means-skip contract. `failedTaskOnMemberRemoved` is still the public entry point and still says "failed" while it now also resolves vertices to CANCELED. If you'd rather not rename it in this PR, please at least update its Javadoc and the IT Javadocs that reference it by name so they describe both branches.
   
   **F7 (IT Javadoc overstating the guarantee):** With the job-status gate, the "either way the vertex reaches CANCELED" statement is closer to true, but please reword it to say explicitly that the guarantee rests on the job being in CANCELING at the time of member loss, and that this is why it also covers RUNNING siblings.
   
   Once the F1 trace/test and the F2 sibling coverage are in place, the rest are doc/naming touch-ups and I'm happy to do a final pass.
   
   <!-- streview-comment:2265 -->


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-5861513756

   @DanielLeens @davidzollo CI follow-up on September 28: our current #12299 and #12454 Java 8 engine jobs both hit `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` (`CANCELED` expected, `FAILED` observed). Their current heads keep this correction separate, and their failed-only retry monitors are active.
   
   I re-read this PR at `db0516982cad`. The current diff still uses the vertex-only `resolveLostMemberState(ExecutionState)` helper. The job/pipeline-status gating and synchronized read/decision discussed in your September 26 replies are not present yet. Could you prioritize that revision, including the master-failover and not-yet-cancelled sibling cases, and post the revised head for review? The acknowledged edge cases need to remain part of the validation; the older patch should not be treated as covering them.
   
   There is also a concrete CI queue issue: Build `36327192530` on the same head still has 6 successful jobs, 73 queued jobs, 14 conditional skips, and no running or failed jobs. This is unchanged from my September 27 18:22 UTC observation through September 28 01:00 UTC. Could you investigate/unblock that fork Build queue while preparing the revision? The public run/job data does not identify why it is stuck.
   
   For additional evidence, I reproduced the worker-cancel assertion on unmodified `dev@146a1b5c510e` locally with Java 8/two processors. An isolated combination of common head `3080371ce733` with the original `ca60502b9e21` patch passed Spotless, full-reactor verification, and 53 selected unit/integration cases, including the worker-cancel test and other failover paths. That is evidence for the scenarios exercised, not validation of the acknowledged missing edge cases or a reason to merge the older mapping as-is. Neither of our open PRs includes that patch.
   


-- 
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: [PR] [Fix][Zeta] Resolve a CANCELING vertex to CANCELED, not FAILED, when its worker is lost [seatunnel]

Posted by "goutamadwant (via GitHub)" <gi...@apache.org>.
goutamadwant commented on PR #12311:
URL: https://github.com/apache/seatunnel/pull/12311#issuecomment-5841261302

   I ran `SplitClusterFaultToleranceIT#testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` in a loop locally to see whether this fixes the `engine-v2-it` flake.
   
   Setup: macOS, 10 cores, with other builds running on the same machine. Each run was a fresh JVM. Base was `dev` at `deb16a3c3`. Head was this PR's diff applied to the same commit. It applies cleanly, and none of the files it touches have changed on `dev` since this branch's base.
   
   | | base | this PR |
   |---|---|---|
   | JDK 8 (1.8.0_172), host load 26-63 | 12 / 20 failed | 0 / 20 failed |
   | JDK 11, `-XX:ActiveProcessorCount=2`, quiet host | 4 / 10 failed | 0 / 10 failed |
   
   Every base failure was the one CI shows: `assertEventuallyCanceled` fails with `expected: <CANCELED> but was: <FAILED>`. `CoordinatorServiceLostMemberResolutionTest` also passes.
   
   An earlier JDK 11 batch also hit `Node failed to start!` on both base and head. I was running other in-process cluster tests at the same time, so this was port and join interference from my setup. The quiet-host rerun above had none of it.
   
   On the change itself: only a vertex that is already CANCELING moves to CANCELED when its worker is lost. DEPLOYING and RUNNING still become FAILED. I also checked the paths where CANCELING does not come from a user cancel:
   
   - A pipeline that is cancelling because a sibling task failed still ends FAILED, through `failedTaskNum` and the FAILING check in `SubPlan#getPipelineEndState`.
   - A pipeline cancelled by `handleCheckpointError` still ends FAILED through the checkpoint coordinator status check in the same method.
   
   So I don't see restore or failure reporting being masked. LGTM from the testing side.
   


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