You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "tomatotomata (via GitHub)" <gi...@apache.org> on 2026/09/16 20:01:06 UTC

[I] [Bug][Zeta] Worker crash during cancellation resolves job as FAILED [seatunnel]

tomatotomata opened a new issue, #12353:
URL: https://github.com/apache/seatunnel/issues/12353

   ### What happened
   
   `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` expects the job to reach `CANCELED` after cancellation has started and a worker crashes before the cancel acknowledgement arrives. Instead, the job reaches `FAILED`.
   
   I reproduced the same result on the unmodified `dev` base `6ee0c374478a7c8be090e3eb33895027c5ac2ffd` and on `#11602` head `a283df0d52b1fc1935ae6358d80518a5af333ae5`, using JDK 17.0.19. Both runs timed out after one minute with `expected: <CANCELED> but was: <FAILED>`.
   
   This is separate from #11602, which changes terminal metrics retry behavior and does not modify the cancellation test or terminal-state code. It also differs from #11679: that issue reports a client that never reaches a terminal status, while this case reaches `FAILED` instead of the expected `CANCELED`.
   
   ### Reproduction
   
   Run the focused E2E test on `dev`:
   
   ```powershell
   .\mvnw.cmd -B -T 1 verify '-DskipUT=true' '-DskipIT=false' '-DfailIfNoTests=false' '-Dlicense.skipAddThirdParty=true' '-Dskip.ui=true' --no-snapshot-updates -pl :connector-seatunnel-e2e-base,:connector-console-seatunnel-e2e -am -Pci '-Dit.test=SplitClusterFaultToleranceIT#testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck'
   ```
   
   ### Expected behavior
   
   Once cancellation has begun, a worker crash before the cancel acknowledgement should not change the job's terminal state from `CANCELED` to `FAILED`.
   
   The review trace points at `SubPlan.getPipelineEndState()` and `addPhysicalVertexCallBack()` as the likely terminal-state decision path. I have not changed that path as part of the metrics PR.


-- 
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] [Bug][Zeta] Worker crash during cancellation resolves job as FAILED [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #12353:
URL: https://github.com/apache/seatunnel/issues/12353#issuecomment-5724550938

   Two facts about this test's provenance and its behaviour on `dev` that I don't think have been stated in the thread, and that argue against anyone treating it as flaky.
   
   **The test is nine days old, and it was added as coverage for a known defect.** `testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` came in on 2026-09-09 with `20900262e`, @davidzollo's #12030 — *"[Test][E2E] Add regression coverage for task stuck in CANCELING when worker crashes mid-cancel"*. So it is not a long-standing test that recently became unstable; it is a regression test for a bug that was never fixed, doing exactly what it was written to do. That reading also fits @DanielLeens's analysis above: the `failedTaskNum > 0` priority in `getPipelineEndState()` has presumably always behaved this way, and #12030 simply made it visible.
   
   **On `dev` it alternates between the JDK legs, which is what a race looks like from the outside.** Reading the completed `Build` runs on `apache/seatunnel@dev` (most are `cancelled` by the next merge, so only these finished):
   
   | `dev` run | Date | `engine-v2-it (8)` | `engine-v2-it (11)` |
   |---|---|---|---|
   | [34801745423](https://github.com/apache/seatunnel/actions/runs/34801745423) | 09-14 03:11 | **fail** | pass |
   | [34821874806](https://github.com/apache/seatunnel/actions/runs/34821874806) | 09-14 08:16 | pass | **fail** |
   | [34935118103](https://github.com/apache/seatunnel/actions/runs/34935118103) | 09-15 06:01 | **fail** | **fail** |
   | [34995029902](https://github.com/apache/seatunnel/actions/runs/34995029902) | 09-15 16:26 | **fail** | pass |
   | [35063682504](https://github.com/apache/seatunnel/actions/runs/35063682504) | 09-16 06:26 | pass | **fail** |
   | [35219017572](https://github.com/apache/seatunnel/actions/runs/35219017572) | 09-17 12:03 | **fail** | pass |
   
   Every completed `dev` run since this test landed has a red `engine-v2-it` leg, and which JDK loses the race varies run to run. One caveat on that table: these are job-level conclusions, and `engine-v2-it` also carries `BackpressureSlowSinkIT` (#12313 is the fix for that one), so not every red cell above is necessarily this test — I confirmed the class-level cause on the 09-17 run and on my own branches, not on all six.
   
   Worth noting the 09-07 run's `engine-v2-it (8)` was already red two days *before* this test existed, so there is at least one other pre-existing problem in that job. I did not chase it down.
   
   None of this changes the diagnosis, and I have nothing to add to the fix — #12311 looks right to me. I'm posting it because "flaky, will clear on rerun" is the natural assumption for a red e2e job, I made that assumption myself earlier in this thread and was wrong, and the provenance makes it clear the assumption is unavailable 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: [I] [Bug][Zeta] Worker crash during cancellation resolves job as FAILED [seatunnel]

Posted by "tomatotomata (via GitHub)" <gi...@apache.org>.
tomatotomata commented on issue #12353:
URL: https://github.com/apache/seatunnel/issues/12353#issuecomment-5716704842

   I took a closer look at #12311 after your note. It already changes a lost CANCELING vertex to CANCELED and adds a focused state-mapping unit test, while keeping the existing crash-before-ack E2E assertion.
   
   The extra cases you called out, especially the ordering around cancellation plus checkpoint cancellation and error reporting, are not obvious in the current tests. I can take a focused tests-only follow-up if that would help, but I do not want to duplicate the implementation in #12311. Would you rather have those cases added there, or handled in a separate test PR?


-- 
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] [Bug][Zeta] Worker crash during cancellation resolves job as FAILED [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #12353:
URL: https://github.com/apache/seatunnel/issues/12353#issuecomment-5707445866

   Corroborating data point on a different platform and JDK, in case it helps narrow this down.
   
   I hit the same failure on **JDK 8 / Linux** (`ubuntu-latest`), where you saw it on JDK 17 / Windows, so it is not JDK- or OS-specific:
   
   ```
   [ERROR] SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck:448
           ->assertEventuallyCanceled:556 » ConditionTimeout
   org.awaitility.core.ConditionTimeoutException: ... expected: <CANCELED> but was: <FAILED> within 1 minutes.
   Caused by: org.opentest4j.AssertionFailedError: expected: <CANCELED> but was: <FAILED>
   [ERROR] Tests run: 203, Failures: 0, Errors: 1, Skipped: 6
   ```
   
   To be sure it was not something in my own branches, I ran it on a branch that is `dev` @ `75b60fa14` plus a three-line comment in `seatunnel-engine/README.md` and nothing else — the comment exists only so change detection schedules `engine-v2-it`. It fails there: [run 35166337277](https://github.com/SEZ9/seatunnel/actions/runs/35166337277).
   
   Two further observations from repeated runs that might be useful:
   
   - **The JDK 11 leg of that same control run passed.** So on Linux it is JDK-8-reproducible but not JDK-11-reproducible in a single sample — consistent with a race rather than a deterministic ordering bug, even though it looks deterministic on any one leg.
   - **It failed 8 out of 8 real executions** of `engine-v2-it (8)` on one of my pull requests (#12299, which does not touch the engine's cancel path), while **passing 3 out of 3** on another (#12298, same base). The only difference I can point at is that #12298 adds one test to that e2e module, so it runs 204 tests where the base and #12299 run 203. Given the test deliberately races a cancel request against a worker shutdown, suite composition shifting the timing is a plausible mechanism — but I have not tested that and offer it only as something to rule out, not as a finding.
   
   Your pointer at `SubPlan.getPipelineEndState()` / `addPhysicalVertexCallBack()` matches what the assertion implies: the job reaches a terminal state, just `FAILED` instead of `CANCELED`, so the terminal-state decision is being made from the crashed worker's vertex outcome rather than from the already-recorded cancellation intent. I have not read that path closely enough to say more.
   


-- 
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] [Bug][Zeta] Worker crash during cancellation resolves job as FAILED [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #12353:
URL: https://github.com/apache/seatunnel/issues/12353#issuecomment-5723586754

   Correction to my earlier comment. The "suite composition" observation I offered there is **wrong**, and I would rather retract it than leave it in the thread as something for someone to chase.
   
   I wrote that this test fails 8/8 on #12299 but passes 3/3 on #12298, and that the only correlate I could see was suite size (204 tests vs 203). The 3/3 was an artifact of my own measurement: I only looked at the newest workflow run on that branch, and GitHub carries unchanged jobs forward into each `rerun --failed` attempt with an identical `started_at`, so a single pass appeared as eight. Reading the two earlier runs on the same branch gives the real record for `engine-v2-it (8, ubuntu-latest)` on #12298:
   
   | Run | Attempt | `SplitClusterFaultToleranceIT` | Suite |
   |---|---|---|---|
   | [34798396872](https://github.com/SEZ9/seatunnel/actions/runs/34798396872) | 1 | **fail** | 204 |
   | [34926657845](https://github.com/SEZ9/seatunnel/actions/runs/34926657845) | 1 | **fail** | 204 |
   | 34926657845 | 2 | **fail** | 204 |
   | 34926657845 | 3 | **fail** | 204 |
   | 34926657845 | 4 | pass | 204 |
   | [34993525332](https://github.com/SEZ9/seatunnel/actions/runs/34993525332) | 1–8 (one execution) | pass | 204 |
   | 34993525332 | 9 | pass | 204 |
   | 34993525332 | 10 | pass | 204 |
   
   So #12298 fails it **4 of 8** real executions, every one of them at 204 tests. The suite-size correlate is directly falsified — the same suite size both passes and fails. Corrected totals for JDK 8 / Linux across everything I have measured:
   
   - #12298 — 4 / 8
   - #12299 — 8 / 8
   - `dev` @ `75b60fa14` + a comment-only change ([run 35166337277](https://github.com/SEZ9/seatunnel/actions/runs/35166337277)) — 1 / 1
   
   **13 failures in 17 real executions (~76%)**, spread over three code bases with no branch correlation. That is a plainer story than the one I told: a base-level race with a high hit rate, not something specific to a branch or a suite.
   
   One detail that may be worth something, since @DanielLeens named the mechanism precisely. Attempts 9 and 10 above were single-job reruns I triggered on the newest head; in both, `SplitClusterFaultToleranceIT` passed and `BackpressureSlowSinkIT.testCheckpointsKeepCompletingUnderSustainedBackpressure` failed instead. Two flaky-under-load tests trading places on the same runner fits the described control path: reaching `failedTaskNum > 0` priority in `getPipelineEndState()` requires the crashed worker's `FAILED` callback to land inside the cancel-ack window, so runner speed decides whether the race is won or lost. It is not evidence for a fix, just consistent with the diagnosis rather than with an ordering bug that would fail every time.
   
   @tomatotomata — agreed that #12311 looks like the implementation for this, and I have no stake in where the extra cases land. My data above is neutral between the two options you offered.
   


-- 
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] [Bug][Zeta] Worker crash during cancellation resolves job as FAILED [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #12353:
URL: https://github.com/apache/seatunnel/issues/12353#issuecomment-5738891481

   Thanks for digging into #12311, @tomatotomata — that is useful context, and I agree we should not duplicate the implementation.
   
   My preference is to add the extra coverage in #12311 itself rather than in a separate tests-only PR. The change that maps a lost `CANCELING` vertex to `CANCELED` is exactly what the new cases exercise, so landing the fix and its deterministic coverage together keeps the terminal-state contract reviewable in one place and avoids a window where the behavior change merges without the ordering cases being pinned down. If the #12311 author would rather keep that PR narrow, a linked follow-up is acceptable, but it should be opened before #12311 merges and referenced from this issue so nothing falls through.
   
   Concretely, what I would like to see covered (whichever PR they end up in), each driven by latches rather than sleeps:
   
   1. Worker failure before any cancellation is requested -> job ends `FAILED`.
   2. Cancellation accepted before the worker failure -> job ends `CANCELED`.
   3. The crash-before-cancel-ack path: cancellation requested, worker dies before the ack, and the result is `CANCELED`, with an assertion that checkpoint cancellation still happens and the failure is still reported (not silently dropped).
   
   Two asks to move this forward:
   
   - Could you check whether #12311's existing state-mapping unit test already asserts anything about checkpoint cancellation or error reporting in case (3)? If it does not, please note that on #12311 so the author knows the gap.
   - Please confirm on #12311 that the existing crash-before-ack E2E assertion stays as-is and that #11602 does not disable or skip it to go green.
   
   If you want to take the tests-only work, go ahead and coordinate with the #12311 author on where it lands, and drop a link here once there is a PR.
   
   <!-- streview-comment:1170 -->


-- 
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] [Bug][Zeta] Worker crash during cancellation resolves job as FAILED [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #12353:
URL: https://github.com/apache/seatunnel/issues/12353#issuecomment-5714101706

   Thanks for the independent reproduction. **Classification: A / Zeta cancellation state-machine correctness.**
   
   The current `dev` control path explains the observed outcome. In `SubPlan.addPhysicalVertexCallBack`, any worker `FAILED` increments `failedTaskNum` and immediately changes the pipeline to `FAILING`; when every task callback arrives, `getPipelineEndState()` gives `failedTaskNum > 0` priority over any canceled task. A worker crash in the cancel-ack window can therefore overwrite an already requested cancellation and end as `FAILED`.
   
   The fix must preserve the distinction between a normal running-job failure and a failure observed after user cancellation has become authoritative. It cannot simply reverse the final-state priority or suppress worker failures. Please keep this as a narrow Zeta lifecycle change with deterministic latch-based coverage for: (1) worker failure before cancellation begins -> `FAILED`; (2) cancellation accepted before the worker failure -> `CANCELED`; and (3) the exact crash-before-cancel-ack path, including checkpoint cancellation and error reporting.
   
   #11602 is a separate metrics PR and should not make itself green by disabling this regression; the behavior needs a dedicated fix and a passing test. I found no focused open PR for this terminal-state contract, so the tracker remains the correct place to establish it before implementation.


-- 
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] [Bug][Zeta] Worker crash during cancellation resolves job as FAILED [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #12353:
URL: https://github.com/apache/seatunnel/issues/12353#issuecomment-5724605437

   Thanks for checking #12311. Since it already changes a lost CANCELING vertex to CANCELED, adds a state-mapping unit test, and keeps the existing crash-before-ack E2E assertion, it makes sense to treat it as the implementation for this issue rather than duplicating it.
   
   For the additional coverage (worker failure before cancellation -> `FAILED`; cancellation accepted before the worker failure -> `CANCELED`; and the crash-before-cancel-ack path including checkpoint cancellation and error reporting), I would prefer to have them added to #12311 so the fix and its regression tests land together. If the author of #12311 would rather keep that PR narrow, a separate tests-only follow-up referencing this issue is fine as well; please coordinate on that PR so the two do not diverge.
   
   Could you also link this issue from #12311 so the history is easy to follow?
   
   <!-- streview-comment:1138 -->


-- 
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] [Bug][Zeta] Worker crash during cancellation resolves job as FAILED [seatunnel]

Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx closed issue #12353: [Bug][Zeta] Worker crash during cancellation resolves job as FAILED
URL: https://github.com/apache/seatunnel/issues/12353


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