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

[PR] [Fix][Zeta] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   -->
   
   ### Purpose of this pull request
   
   Fixes [#12164](https://github.com/apache/seatunnel/issues/12164).
   
   `TaskExecutionService.deployLocalTask` could leave a stale `TaskGroupLocation` in `executionContexts` / `cancellationFutures` when a failure happened **after** context publication but **before** / during task submission (for example `onContextPublished`, `submitThreadShareTask`, or `submitBlockingTask` throwing `RejectedExecutionException` during failover/restore).
   
   Because `deployTask` treats an existing `executionContexts` entry as an active task and returns success without redeploying (master-failover skip path), that leak made the location permanently un-redeployable and could hang the job silently.
   
   This PR:
   
   - Publishes `executionContexts` and `cancellationFutures` together
   - Rolls both map entries back when a failure occurs after publication
   - Preserves the existing master-failover behavior where an already active, healthy task still returns success without being redeployed
   - Keeps the change narrow (no unrelated executor / classloader lifecycle changes), as requested in the issue discussion
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   This is an internal Zeta engine correctness fix. There is no config, API, documentation, or connector behavior change for users.
   
   ### How was this patch tested?
   
   Unit tests in `TaskExecutionServiceTest`:
   
   1. **`testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy`** (new)
      - Injects a `RejectedExecutionException` in the post-publish callback
      - Asserts the published execution context and cancellation future do not leak
      - Asserts a subsequent `deployTask` for the same `TaskGroupLocation` actually redeploys and executes
   
   2. **`testDeployTaskIdempotentWhenAlreadyRunning`** (existing)
      - Confirms healthy active-task failover skip behavior is preserved
   
   3. **`testDeployTaskHandlesFailureBeforeContextPublication`** (existing)
      - Confirms the pre-publication failure cleanup path still works
   
   Local verification:
   
   ```bash
   ./mvnw -pl seatunnel-engine/seatunnel-engine-server -Dtest=TaskExecutionServiceTest -DfailIfNoTests=false -Dskip.spotless=true test
   ```
   
   Result: `Tests run: 16, Failures: 0, Errors: 0, Skipped: 0`
   
   ### Check list
   
   * [x] 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)
   * [x] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
   * [x] If necessary, please update `incompatible-changes.md` to describe the incompatibility caused by this PR.
   * [x] If you are contributing the connector code, please check that the following files are updated:
     1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
     3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
     4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
     5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)
   
   N/A for the checklist items above: no new jars, docs, incompatible changes, or connector updates.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh thanks for reposting. The drop path 3 row came through this time, but the status table is cut off again: it ends at the row "Assertions in overridden `submit()` vs production `catch (Throwable)`" with an empty status cell, and the last two of the seven statuses are missing.
   
   **Dropped-task accounting (`taskDone`)**
   
   I've noted what you listed for the three drop paths:
   - **Never submitted:** **4L** in `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection`.
   - **Removed from the cooperative queue:** **1L** in the same test.
   - **Cancelled before start:** `testRollbackAccountsBlockingCancelledBeforeWorkerStarts`.
   
   I've also noted the cooperative split you describe: rollback accounts for the task when the worker never owns **RUNNING**, and the worker accounts once when it does (`testRollbackDoesNotCloseCooperativeTaskDuringCall`).
   
   This point stays open until I have checked it against the diff at `7246ffc847`. Your description explains the intent, but I have not yet confirmed it in the code.
   
   **Earlier points reported as done**
   
   These four also stay pending until I verify them against the diff at `54f42174d0` / `7246ffc847` and the PR body:
   - The `deployLocalTask` Javadoc.
   - The callback rollback test: cleanup in `finally`, and the static stop on the deserialized task.
   - The PR description for `TaskGroupContext`.
   - `TaskGroupContext` itself: no bypass setters on `classLoaders` and `jars`, with `jars` now `volatile`.
   
   **Still needed**
   
   Could you post the status, and the commit it landed in, for these three:
   
   1. **Assertions inside the overridden `submit()`.** Are they still swallowed by the production `catch (Throwable)`, or are they now surfaced to the test thread?
   2. **Partial-submit test setup.** Are the rejecting executor and PART mode now installed inside the `try`/`finally`, so the shared server is always restored?
   3. **Test helper cleanup.** This covers the unused `callCount()` accessor, the inline fully-qualified type, and the two different ways of setting the executor override.
   
   Posting these three as a short separate comment may be the safest way to avoid another cut-off.
   
   <!-- streview-comment:2734 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @DanielLeens Thanks for the re-review on `258a779d7` — especially for confirming Issue 1 is resolved and for the precise Issue 2 race analysis on the thread-share path.
   
   I pushed a follow-up (`16111de97`) that closes the recommended Issue 2 fix:
   
   - In `CooperativeTaskWorker.run()`, immediately after dequeue and **before** `currRunningTaskFuture.put(...)` / classloader lookup, add the same early bailout as `BlockingWorker`: if `executionContexts.get(loc) == null` or `isCancel`, call `taskDone` and `continue`/`break`
   - Keep the existing `executionCompletedExceptionally()` short-circuit in that same guard
   - Use the already-resolved `TaskGroupContext` for the classloader lookup instead of re-fetching from the map
   
   On Issue 3 (rolled-back attempts skipping `finishedExecutionContexts` / `updateMetricsContextInImap()`): agreed this is diagnostics-completeness only; accepting it as-is for this PR rather than broadening scope.
   
   On the flagged `connector-file-local-it (11)` / `LocalFileIT.testLocalFileBinaryUpdateModeContinuousDiscoveryWithNonRecursiveScan` failure: this push will re-trigger CI. I also traced no mechanism by which the new `BlockingWorker`/`CooperativeTaskWorker` early-bailout would delay a normal (non-rollback) cancel of a long-running continuous job, but I'll watch that specific job on the new run and investigate if it recurs.
   
   Local: `TaskExecutionServiceTest` — `Tests run: 17, Failures: 0, Errors: 0, Skipped: 0`.
   
   Please take another look when you have time. Thanks again!


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @DanielLeens and @SEZ9. Understood: no further source change from me. I will keep the two CI failures separate from this fix, and I will share the new Kafka job link if a later retry produces a real assertion failure.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Synced this branch with the latest `upstream/dev` and pushed merge head `34a4364a85` (clean merge, no conflicts).
   
   Local verification:
   ```bash
   ./mvnw -pl seatunnel-engine/seatunnel-engine-server -Dtest=TaskExecutionServiceTest -DfailIfNoTests=false -Dskip.spotless=true test
   ```
   `Tests run: 27, Failures: 0, Errors: 0, Skipped: 0`
   
   Fork CI is re-running on this head. If any unrelated baseline failures show up again (e.g. `SplitClusterFaultToleranceIT` / #12311, Testcontainers registry flakes), I will paste the job links here.
   
   Community review threads already concluded with no remaining source blockers on the PR-owned files. Could a committer with write access please take a look for formal approve/merge when CI on this head is acceptable? Thanks!


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 thanks for the follow-up. Exact lines at head `b41db8fc56213ea698614a103b1882e02ac28c9a` (the five points landed on or before `4083d330a2` and are unchanged here).
   
   1. **Rollback and `taskDone`**
   
   - `registerAllDeploymentTasks` is called before publish, then defined here:
     - call: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java#L781
     - method: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java#L1891-L1901
   - `accountForTasksDroppedAfterRollback` accounts cooperative-queue removals, never-submitted tasks, and futures cancelled before `run()`:
     - call: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java#L872
     - method: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java#L1963-L2005
   - `assertFailedGenerationAccounting` in the three tests:
     - never submitted + removed from the cooperative queue (`..., 4`): https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L893
     - cancelled before start (`..., 3`): https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L1046
     - post-publish callback failure (`..., 1`): https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L713
   
   2. **`deployLocalTask` Javadoc** — post-`contextPublished` uses `rollbackPublishedDeployment` and completes `FAILED`; the pre-publication branch keeps `completeExceptionally(t)`:
   
   https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java#L696-L702
   
   3. **Callback-side rollback test**
   
   - cleanup is in `finally`, and it calls `ExecutionMarkerTask.requestStop()`: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L750-L753
   - static `STOP`, `reset()`, and `requestStop()`: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L2551-L2561
   - `reset()` before redeploy: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L726
   
   4. **PR description** — no lines, as requested. The scope lists `TaskGroupContext.java`, `claimJarsForClassLoaderRelease()`, and `classLoaders` / `jars` as `volatile` with `@Setter(AccessLevel.NONE)`.
   
   5. **`TaskGroupContext`** — `@Setter(AccessLevel.NONE)` and `volatile` on both `classLoaders` and `jars`:
   
   https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/execution/TaskGroupContext.java#L75-L86
   
   **Three smaller test-side points** — all done, on or before `6d6a380a9b`, still present at `b41db8fc`.
   
   - **Assertions inside the overridden `submit()`:** done. `submit()` only records the await result on an `AtomicBoolean`, then throws `RejectedExecutionException`. There is no assertion inside `submit()`. The test thread asserts those flags after deploy returns.
     - record only: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L798-L811
     - asserted outside: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L864-L869
   - **Partial-submit test setup:** done. `ThreadShareMode.PART` and the rejecting executor are installed inside the `try`. `finally` clears the override, shuts the executor down, and restores `previousMode`.
     - inside `try`: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L790-L819
     - `finally`: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L945-L960
   - **Test helper cleanup:** done. `callCount()` is gone. `threadShareQueueContainsLocation` uses the `BlockingDeque` import, not an inline FQCN. The executor override is written only through `setBlockingTaskExecutorOverride`.
     - import: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L72
     - helper: https://github.com/apache/seatunnel/blob/b41db8fc56213ea698614a103b1882e02ac28c9a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TaskExecutionServiceTest.java#L1727-L1730
   
   Please check these against `b41db8fc` and let me know if any line is off.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 Mapping for the both-sides checklist item:
   
   - Callback side (`onContextPublished`):
     `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy`
   - Submission side (`submitBlockingTask` / `RejectedExecutionException` after partial submit):
     `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection`
   
   Both already redeploy through `deployTask(Data)` (not `deployLocalTask`), so they hit the `executionContexts.containsKey` skip branch that #12164 describes. Same mapping is in the PR description checklist §2.
   
   Happy to take any further comments here on the 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: [PR] [Fix][Zeta] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh Thanks for the mapping — that closes the both-sides checklist item for me:
   
   - Callback side (`onContextPublished`) → `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy`
   - Submission side (`submitBlockingTask` / `RejectedExecutionException` after partial submit) → `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection`
   
   The key point is that both redeploy assertions go through `deployTask(Data)` rather than `deployLocalTask`, so they exercise the `executionContexts.containsKey` skip branch instead of bypassing it. Nothing further from me on the code side for head `fee6db3b3c`.
   
   One remaining ask before merge: the fork run for this head (`34558932185`) finished with a failure — `transform-v2-it-part-1 (11)` and `all-connectors-it-2 (8)` failed and `paimon-connector-it (11)` was cancelled. None of those areas are touched by this diff, so I don't expect this change caused them, but I'd like the CI item closed out properly rather than left as "unrelated by inspection." Could you rerun those jobs on the current head and post the result, or, if they fail again, link the failure logs so we can confirm they're pre-existing flakes? Once that's in, this is good to go from my side.
   
   <!-- streview-comment:999 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh thanks for the detailed update on `0b242a3271`. I'm going by your description here rather than a fresh read of the diff, and I'm leaving the two High items from review 6038243309 to that review.
   
   **Dropped-task accounting (Medium)**
   
   The concern was that tasks dropped by the rollback were never counted through `taskDone`, so the rolled-back tracker could never complete on its own. `registerExpectedBlockingTasks` plus `accountForTasksDroppedAfterRollback`, with `assertFailedGenerationAccounting` checking that the latch remaining is 0 and the done count equals the expected task count, is the direction I was asking for.
   
   I couldn't read the dropped-paths table in your update, so please confirm that each drop path reaches the accounting, and name the test that covers it:
   - removed from the cooperative queue
   - cancelled before start
   - never submitted
   
   From the three tests you listed (partial-submit, cancel-before-start, cooperative close-failure), I can't tell which one covers removal from the cooperative queue.
   
   **Not mentioned in the part of your update I can see**
   
   Please say for each whether it is fixed in `0b242a3271` or still pending:
   - **`deployLocalTask` Javadoc (Medium):** it described only the pre-publication failure contract. The post-publish rollback and its different completion mode need documenting.
   - **Callback-side rollback test:** cleanup sits outside `finally`, and `stop.set(true)` has no effect on the deserialized task.
   - **PR description:** it says only `TaskExecutionService` and its test are touched, but `TaskGroupContext` gains a public method and a `volatile` field.
   - **`TaskGroupContext` setters:** the class-level setter annotation lets `setClassLoaders`/`setJars` bypass the claim-once invariant, and `jars` is not `volatile` while `classLoaders` is.
   - **Assertions inside the overridden `submit()`:** they are swallowed by the production `catch (Throwable)` they are meant to guard.
   - **Partial-submit test:** the rejecting executor and PART mode are installed on the shared server before entering `try`/`finally`.
   - **Test helper cleanup:** the unused `callCount()` accessor, the inline fully-qualified type, and the executor override being set two different ways.
   
   The two Medium items matter most; the rest are Low-severity cleanups.
   
   <!-- streview-comment:2603 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   CI update on head `e3a9b8eb` (follow-up to the SEZ9 mapping in https://github.com/apache/seatunnel/pull/12218#issuecomment-7071979750):
   
   - Fork **Build** is **green**: https://github.com/Rangsh/seatunnel/actions/runs/44970214239 (run attempt **3**, `completed`/`success` on this SHA).
   - On an earlier attempt the only failure was `all-connectors-it-1 (11)` — Maven Wrapper download **HTTP 429** before tests started (infra flake, unrelated to this diff). `unit-test` and `engine-v2-it` were already green on that attempt; re-running the failed job(s) completed the matrix.
   - Local: `TaskExecutionServiceTest` — **27/27** on `e3a9b8eb`.
   
   @SEZ9 — please let me know if anything is still open after the `e3a9b8eb` changes; happy to adjust. @DanielLeens FYI.
   
   Could @davidzollo @nzw921rx or another committer with write access please review for **formal approve / merge** for #12164? Thanks.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh thanks for the follow-up. I've noted your status for the three rows you report as done in 6d6a380a9b and still present at 4083d330a2:
   
   1. **Assertions inside overridden `submit()`**: `submit()` only records the await result on an `AtomicBoolean`, and the assertions run on the test thread after deploy returns.
   2. **Partial-submit setup**: `ThreadShareMode.PART` and the rejecting executor are installed inside the `try`, and `finally` clears the override, shuts the executor down and restores `previousMode`.
   3. **Test helper cleanup**: `callCount()` is removed, the `BlockingDeque` import is used, and the override is written only through `setBlockingTaskExecutorOverride`.
   
   That description matches what was asked. I haven't checked these against the diff yet, so I'm not marking them resolved until I have.
   
   Your comment only covers these three rows, so I can't tell where the other earlier points stand. Could you give a one-line status at 4083d330a2 for each of these?
   
   - **Rollback and `taskDone`**: are tasks dropped by the rollback (removed from the cooperative queue, cancelled before start, or never submitted) now counted, so the rolled-back tracker can complete?
   - **`deployLocalTask` Javadoc**: does it now describe the post-publish rollback and its different completion mode?
   - **Callback-side rollback test**: is the cleanup now inside `finally`, and what happened to the `stop.set(true)` that had no effect on the deserialized task?
   - **PR description**: has it been updated to mention the `TaskGroupContext` changes (the new public method and the `volatile` field)?
   - **`TaskGroupContext`**: can the class-level setter (`setClassLoaders`/`setJars`) still bypass the claim-once invariant, and is `jars` still non-`volatile` while `classLoaders` is?
   
   <!-- streview-comment:2761 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @Rangsh for reading both logs yourself, that saves everyone time. I cross-checked them on fork run 38496659794 (head `35f5a2fcf7c`), and your reading holds:
   
   - `engine-v2-it (11)` is the same `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` cancel-vs-worker-loss race from my last note. #12311 is still open and not on `dev`, so a sync will not clear it, and nothing in this diff touches that path.
   - `kafka-connector-it (17)` fails only on the Testcontainers image build (`received unexpected HTTP status: 500 Internal Server Error`), before any Kafka test logic runs. That is a registry/runner flake, not related to this PR.
   
   My conclusion is unchanged: no source blocker on the three PR-owned files, and the head has not moved since my last review, so this is not a new re-review. The remaining gates are the CI items above (the Kafka one should clear on any fresh run) and the committer approval; as a read-only reviewer I cannot do the formal approval. One small practical note: the branch is now 13 commits behind `dev`, so whenever you next sync, that push will also give you a fresh fork run for the Kafka lane. Thanks again for the patient iterations!
   


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @DanielLeens for the detailed review. I synced the latest `dev` and addressed all three issues in `29d664924`.
   
   **Issue 1:** `submitBlockingTask` now builds the accepted futures in a local list. The success path still waits for `startedLatch` before publishing them, so #12454's "publish after startup" behavior is preserved. Only the submit-failure path publishes the already-accepted futures before rethrowing, because that path never awaits the latch; rollback can then cancel them, including workers that have not started. Covered by `testBlockingInitFailureDuringSubmitCompletesAsFailed`.
   
   **Issue 2:** the new early return is now limited to the rollback signal (`taskGroupContext == null` or a null classloader map). An ordinary `isCancel` still runs `init()`, `call()`, and `close()`. `testBlockingWorkerStartedAfterCancelStillCloses` pins that contract.
   
   **Issue 3:** `abortAfterFailedPublish` records the failure and cancels workers without setting `isCancel`, so `taskDone` reports `FAILED` instead of `CANCELED`. The deploy thread also completes the same future normally with `FAILED` if no worker completed it first, rather than completing it exceptionally and hiding that state. Covered by `testAllBlockingDeployFailureAfterWorkersStartedCompletesAsFailed`.
   
   I also replaced the `Thread.sleep(200)` quiescence check with a flag set by the probe task when it observes interruption, and the same-package test now assigns `blockingTaskExecutorOverride` directly instead of using reflection.
   
   `TaskExecutionServiceTest` is green locally (27 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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @DanielLeens for the careful re-review, and for spelling out both Low items so clearly.
   
   Both are addressed on `d03ef1ba6`:
   
   1. **Worker rollback guards now use the tracker's own context.** `BlockingWorker` and `CooperativeTaskWorker` no longer call `executionContexts.get(taskGroupLocation)`. They read `TaskGroupExecutionTracker.context`, so a later deployment at the same location cannot hide this generation's rollback signal (a null classloader map). An ordinary cancel still runs `init()` / `call()` / `close()`.
   
   2. **The two tests are tightened.** `releaseClassLoadersOnce` is now package-visible, in the same style as `blockingTaskExecutorOverride`, and `testRecycleClassLoaderAfterRollbackClaimDoesNotDoubleRelease` calls it directly instead of reflecting on the private name. `testTaskGroupContextClassLoaderReleaseClaimIsAtomic` now races two threads on one context with a `CyclicBarrier` and asserts exactly one non-null claim, so removing the CAS would no longer leave the test green.
   
   `TaskExecutionServiceTest` is green locally (27 tests). This is still a fork PR, so I cannot approve the workflow myself. @SEZ9, when you have a moment, could you please approve and run the workflows on this head? Thank you both.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @DanielLeens for the careful re-review, and for tracing this down to the exact line. The pre-publication regression was mine, and your diagnosis was exactly right: the shared `catch` made the pre-publication branch complete with a FAILED state instead of exceptionally, so the `Task <loc> complete with error <msg>` severe log was never written and `TaskDeploymentPrePublicationClassLoaderLeakIT` failed at line 425.
   
   Both points are now addressed:
   
   1. **Issue 1 fixed on `d1f6796a`.** The `catch` is split on `contextPublished`:
      - post-publish: `rollbackPublishedDeployment(...)`, then `resultFuture.complete(new TaskExecutionState(loc, FAILED, t))`, so a FAILED already completed by `taskDone` is preserved;
      - pre-publication: `onFailureBeforeContextPublished.accept(t)`, then `resultFuture.completeExceptionally(t)`. This restores the previous completion and logging contract for that branch, which now matches `dev` again.
   
   2. **`dev` synced.** Merged latest `upstream/dev` (`b0f6feddf`) in `154d6e989` with no conflicts. The branch is now up to date with `dev` (ahead 10, behind 0).
   
   Locally `TaskExecutionServiceTest` is green (27 tests) and spotless has been applied. The fork `Build` run for the merged head is in progress now (`38396665202`); I will post the `engine-v2-it` / `TaskDeploymentPrePublicationClassLoaderLeakIT` results as soon as they complete. I also noticed the two `elasticsearch-connector-it` failures — as you said, this PR touches no Elasticsearch code, so I'll treat them as unrelated unless they show up again.
   
   @SEZ9, when you have a moment, would you mind approving and running the workflows on this head? Thank you both for the patient rounds on this one.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @DanielLeens @SEZ9 @zhangshenghang
   
   Thanks for the detailed review on `e778df2e24`. **Latest push:** `0b242a3271` on branch `fix/zeta-deploy-local-task-rollback-12164` — addressing the remaining **High** items from [Daniel’s review](https://github.com/apache/seatunnel/pull/12218#pullrequestreview-6038243309) and the checklist in [SEZ9’s comment](https://github.com/apache/seatunnel/pull/12218#issuecomment-7144951092).
   
   Contributing to **Seatunnel** / fixes **#12164**.
   
   ---
   
   ## Daniel — blocking items (review 6038243309)
   
   ### Issue 1 (High): rollback must survive cooperative `close()` failures
   
   **Ask:** Catch **`Throwable`** on the rollback close path, log/suppress, still remove context, release classloaders **where applicable**, complete **FAILED**; add a test where cooperative `close()` throws and we still redeploy cleanly.
   
   **Fixed on `0b242a3271`:**
   - `closeTaskAfterRollbackIfNeeded` catches **`Throwable`**, logs, adds suppressed to the deployment failure when present, and continues rollback bookkeeping (context removal, latch/dropped-task accounting, **classloader release where applicable** via the existing published-context cleanup path).
   - New test: `testRollbackSurvivesCooperativeCloseFailureAndAllowsRedeploy` — asserts **FAILED**, `assertFailedGenerationAccounting`, no stuck active context, and a subsequent redeploy runs.
   
   ### Issue 2 (High): cancel-before-start test must gate like partial-submit
   
   **Ask:** Do not reject the tail blocking submit until the **first blocking worker has entered `call()`**.
   
   **Fixed on `0b242a3271`:**
   - `testRollbackAccountsBlockingCancelledBeforeWorkerStarts` — rejecting `submit()` awaits `firstEnteredCall` (via `PartialSubmitProbeTask.armCallGate`) before throwing on the tail; post-deploy gate flags + `assertFailedGenerationAccounting(service, location, 3)`.
   
   ### Cross-cutting: direct dropped-task / generation accounting
   
   **Fixed on `e778df2e24` (extended on `0b242a3271`):**
   - `registerExpectedBlockingTasks` + `accountForTasksDroppedAfterRollback` on rollback paths.
   - **`assertFailedGenerationAccounting`** — `lastLocalDeployResultFuture` **FAILED** plus tracker `completionLatchRemainingForTests() == 0` and `tasksReportedDoneCountForTests() == expectedTaskCount` via `lastLocalDeployExecutionTrackerForTests`.
   - Used in partial-submit (4 tasks), cancel-before-start (3), and cooperative close-failure (1) tests on current HEAD.
   
   ---
   
   ## SEZ9 — Item 1: dropped paths table (full)
   
   Rows follow the drop-path order in your checklist (never submitted → cancelled before start → removed from cooperative queue).
   
   | Drop path | What happens | Direct tracker / ownership assertion? | Primary test(s) |
   |-----------|----------------|----------------------------------------|-----------------|
   | **(1) Never submitted (blocking tail)** | `registerExpectedBlockingTasks` before submit loop; mid-batch `RejectedExecutionException` leaves a tail that never enters `call()` | **`assertFailedGenerationAccounting`** + `PartialSubmitProbeTask.enteredCall(4L)` false | `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection` |
   | **(2) Cancelled before worker starts** | Second blocking future cancelled while first blocking already in `call()`; later tail submit rejected | Gate flags after deploy + **`assertFailedGenerationAccounting(3)`** + `enteredCall(11L/12L)` false | `testRollbackAccountsBlockingCancelledBeforeWorkerStarts` |
   | **(3) Removed from cooperative queue** | Tracker removed from `threadShareTaskQueue`; `close()` before `taskDone` | Cooperative `close()` **Throwable** must not block rollback — **`assertFailedGenerationAccounting(1)`** + redeploy | `testRollbackSurvivesCooperativeCloseFailureAndAllowsRedeploy` |
   
   Redeploy-after-rollback paths still use **`deployTask(Data)`** + `ExecutionMarkerTask` in `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy` and `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection`.
   
   **`TaskExecutionServiceTest`:** **29/29** Surefire executions on HEAD — **25** `@Test` methods, **one** `@ParameterizedTest` with **2** invocations (`@ValueSource(booleans = {false, true})`), and **one** `@RepeatedTest(2)`.
   
   ---
   
   ## SEZ9 — Items 2–5 (one line each)
   
   | # | Item | Status |
   |---|------|--------|
   | **2** | **`deployLocalTask` Javadoc** — post-publish vs pre-publication completion | **Fixed on `6d6a380a9b` (on HEAD `0b242a3271`).** After `contextPublished`, failure runs `rollbackPublishedDeployment` and completes **FAILED** (workers may finish the same future first). Before publication, still **`completeExceptionally(t)`** so severe-error log + master notification contract unchanged. |
   | **3** | **PR description** mentions `TaskGroupContext` changes | **Fixed on the PR body** for scope: lists `TaskGroupContext.java` and **`claimJarsForClassLoaderRelease()`** / once-only classloader release. On HEAD code (`6d6a380a9b`), **`classLoaders` and `jars` are `volatile`** with `@Setter(AccessLevel.NONE)` — happy to add an explicit **volatile** bullet to the PR description if you want it mirrored in prose there. |
   | **4** | **`TaskGroupContext`** — setters bypassing claim-once; `jars` visibility | **Fixed on `6d6a380a9b`.** `@Setter(AccessLevel.NONE)` on `classLoaders` and `jars`; both fields are **`volatile`**. |
   | **5a** | Callback-side rollback / **`deployTask(Data)` redeploy** tests: cleanup outside `finally`; `stop.set(true)` ineffective on deserialized tasks | **Fixed on `6d6a380a9b`.** `ExecutionMarkerTask` uses **static** `STOP` + `requestStop()` (not per-instance `stop` on serialized tasks). **`ExecutionMarkerTask.reset()`** runs before each redeploy marker use; **`finally`** calls `requestStop()` + `cancelTaskGroup` + executor/mode restore so static flags do not leak across tests. |
   | **5b** | Assertions inside overridden `submit()` swallowed by production `catch (Throwable)` | **Fixed on `66af82ec9d` / `6d6a380a9b`.** Custom `submit()` only updates gate latches/flags and throws `RejectedExecutionException`; assertions run **after** `deployTask` / `deployLocalTask` returns. |
   | **5c** | Partial-submit test installs rejecting executor and PART mode before `try`/`finally` | **Fixed on `6d6a380a9b` (retained on `0b242a3271`).** PART mode, rejecting executor, and jar setup are inside **`try`**; `finally` shuts down executor, clears overrides, restores thread-share mode, deletes temp jar. |
   | **5d** | Unused `callCount()`, inline FQ type, executor override “two ways” | **Fixed on `6d6a380a9b`; one nit deliberately left.** (1) **Removed** unused `ExecutionMarkerTask.callCount()`. (2) **Unified** blocking override on `setBlockingTaskExecutorOverride`; **intentionally** applied to **both** `realService` and the Mockito spy because the spy does not share the blocking-executor field with the delegate (commented in test). (3) **Deliberately left:** local `java.util.concurrent.CompletableFuture` in `assertFailedGenerationAccounting` — happy to switch to the engine import in a tiny follow-up to avoid unrelated import churn if you prefer zero FQ locals. |
   
   ---
   
   ## Verification
   
   - **HEAD:** `0b242a3271` · **Branch:** `fix/zeta-deploy-local-task-rollback-12164`
   - **Production on this push:** `TaskExecutionService.java` only (close **Throwable**, gates, accounting hooks, test hooks).
   - **Javadoc / `TaskGroupContext`:** on HEAD from `6d6a380a9b`, not re-touched in `0b242a3271`.
   - Local on HEAD: `spotless:apply`, module `verify`, **`TaskExecutionServiceTest` 29/29**.
   - Fork **Build** for `0b242a3271`: https://github.com/Rangsh/seatunnel/actions/runs/45525756694 (**queued** at post time; prior green on `e778df2e24`: [45305542167](https://github.com/Rangsh/seatunnel/actions/runs/45305542167)).
   
   Happy to adjust wording or split this into threaded replies if you prefer. Thanks again for the review.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 — drop-path / `taskDone` summary for the pending push:
   
   **Three rollback drop paths (all counted toward latch via `accountDroppedTask` → `taskDone`):**
   1. **Never started worker** — cancelled cooperative queue / blocking not yet RUNNING: sweep closes + `taskDone` on deploy thread.
   2. **Dropped wins ownership** — `tryMarkDropped` before worker claims RUNNING: worker skips init/call; rollback path closes + `taskDone`.
   3. **Worker already RUNNING** — worker owns completion: rollback does **not** `close()` during active cooperative `call()`; worker reports `taskDone` as usual.
   
   **When `taskDone` is skipped on rollback:** only when the worker already owns RUNNING and will account via the normal worker `taskDone` path (not double-counted).
   
   **Checklist:** Issue 3/4/C1/5 tests above + PR body test inventory aligned. Pushing code next.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @DanielLeens Thanks for the thorough review — especially the partial-submission analysis in Issue 1. That gap was real, and I’ve addressed it in the follow-up commit (`258a779`).
   
   Changes:
   1. Hoisted `executionTracker` out of the `try` block so post-publish failure can best-effort abort already submitted / enqueued work before bookkeeping is removed
   2. Updated `submitBlockingTask` to record each `Future` as it is submitted, so a mid-batch `RejectedExecutionException` still leaves earlier workers reachable for cancellation
   3. On rollback: abort the tracker, remove matching entries from `threadShareTaskQueue`, release classloader references owned by the published context, then clear `executionContexts` / `cancellationFutures`
   4. Added `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection`, which injects a real `RejectedExecutionException` from `submitBlockingTask` after partial submission (mixed thread-share + blocking under `PART` mode), and asserts:
      - no leaked active context / cancellation future
      - no residual cooperative-queue trackers
      - orphaned tasks stop running
      - classloader references are released
      - a later deploy of the same `TaskGroupLocation` actually executes
   
   `TaskExecutionServiceTest`: `Tests run: 17, Failures: 0, Errors: 0, Skipped: 0`
   
   Please take another look when you have time. Thanks again!


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks, @Rangsh and @SEZ9. That is a helpful separation of the two failures. I checked the upstream fix status again: #12311 is still open and unmerged, so a `dev` sync by itself does not bring that cancellation-race fix into this branch yet. The reported engine failure and the Kafka image-build HTTP 500 should not be repaired by unrelated patches in this PR.
   
   No empty commit or extra source change is needed just to obtain a new result. A maintainer can rerun the failed Kafka job; if the next execution reaches a Kafka assertion and fails there, please share that new job link so we can assess that different failure. Once final-head CI is acceptable, write-capable maintainer approval remains the review gate. This is a discussion follow-up on the unchanged head, not a fresh source review.
   


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @DanielLeens Thanks for catching the classloader-release race — that was a real gap in the rollback path.
   
   **Issue 1 (atomic claim):** addressed in `4de899d4e`.
   - Added `TaskGroupContext.claimJarsForClassLoaderRelease()` (`AtomicBoolean` compare-and-set) so only the first of `releaseClassLoadersFromPublishedContext` / `recycleClassLoader` actually calls `ClassLoaderService.releaseClassLoader`.
   - Both paths now go through a shared `releaseClassLoadersOnce(...)`.
   - `BlockingWorker` / `CooperativeTaskWorker` use null-safe `getClassLoader(taskId)` so a concurrent claim cannot NPE mid-start.
   - Added unit coverage for single-claim semantics and “rollback claims first, then `taskDone`/`recycleClassLoader` must not double-decrement a sibling task group’s shared job-scoped ref count”.
   
   **Issue 2 (`SplitClusterFaultToleranceIT`):** acknowledged. This commit does not touch that cancel/failover path; we’ll root-cause it against a clean `dev` baseline / re-run `engine-v2-it` on the updated head (and treat the Maven wrapper 403 as infra needing a clean rerun). Happy to follow up once CI on `4de899d4e` 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


Re: [PR] [Fix][Zeta] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @Rangsh — I independently pulled the fork run you referenced (`Rangsh/seatunnel` run `34433792914`) rather than taking the summary at face value: it's `completed`/`success`, 79 success + 14 skipped + 0 failure, and I confirmed by job name that `engine-v2-it (8, ubuntu-latest)`, `engine-v2-it (11, ubuntu-latest)`, `connector-file-local-it (8, ubuntu-latest)`, and `connector-file-local-it (11, ubuntu-latest)` are all `success` — exactly the jobs I asked to see finish green in my last review before treating the CI condition as satisfied. That condition is now met.
   
   Combined with the code-level findings from my last two rounds — Issue 1 (partial-submission orphaned-task/classloader-leak risk) resolved and verified by a genuine regression test in `258a779d7`, and Issue 2 (`CooperativeTaskWorker` asymmetry) resolved and traced correct in `16111de97` — I don't have any remaining blocking findings on this PR. Head is still `16111de97e`, so there's nothing new to re-review on the code side this round.
   
   On the non-blocking Low item (a deterministic test that forces the `CooperativeTaskWorker` race rather than relying on timing): agreed this is a nice-to-have, not a blocker — I'm fine leaving it out of this PR's scope unless a maintainer specifically wants it landed here.
   
   As I have comment-only review rights on this repo, a maintainer with write-level review permission still needs to give the formal approve/merge — but from a correctness and safety standpoint, I don't see anything left blocking this 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: [PR] [Fix][Zeta] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @DanielLeens Thanks for the third-round re-review — glad Issue 2 and the previously flagged `connector-file-local-it` concern are confirmed resolved.
   
   Quick CI update on the fork run you were watching ([Rangsh/seatunnel` run 34433792914](https://github.com/Rangsh/seatunnel/actions/runs/34433792914)):
   
   - First pass had a few unrelated flakes (`engine-v2-it (11)` = `SinkErrorToMysqlIT` container-thread teardown timeout; plus `doris`/`oracle-cdc`/`kudu`), none of which touch this PR's `TaskExecutionService` rollback path.
   - After `--failed` re-run, the run is now fully green: **79 success / 14 skipped / 0 failure**.
   - Confirmed green on the jobs you called out: `connector-file-local-it` (8 & 11), and `engine-v2-it` (8 & 11).
   
   On the non-blocking Low item (deterministic `CooperativeTaskWorker` race coverage): agreed it's a nice-to-have; happy to leave it out of this PR's scope unless a maintainer prefers it landed here.
   
   Please take another look when convenient. Thanks again!


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks for mapping the test coverage. On `e3a9b8eb`, the submit loop records each task immediately before submitting it, so a middle rejection leaves the unvisited tail out of the accounting list. Also, a cancelled future can be done while its worker is still unwinding. Please add direct assertions for the failed generation: cover the unvisited tail, a future cancelled before start, and a running worker held until explicitly released. Assert that each dropped task is counted exactly once and the running worker isn't counted early.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 — short status for the three rows cut off from the previous comment. Status: all three Done in 6d6a380a9b, and still present at head 4083d330a2.
   
   1. Assertions inside overridden submit() — Done in 6d6a380a9b.
      submit() only records the await result on an AtomicBoolean and then throws RejectedExecutionException. The assertions run on the test thread after deploy returns, in testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection (firstBlockingCallGateSatisfied / firstBlockingCallGateTimedOut) and testBlockingInitFailureDuringSubmitCompletesAsFailed (firstWorkerInitObserved / laterSubmitAllowed). There is no Assertions call inside submit().
   
   2. Partial-submit setup — Done in 6d6a380a9b.
      In testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection the try starts immediately after previousMode is captured. ThreadShareMode.PART and the rejecting executor are installed inside that try. finally clears the override, shuts the rejecting executor down, and restores previousMode.
   
   3. Test helper cleanup — Done in 6d6a380a9b.
      callCount() is removed. threadShareQueueContainsLocation now uses the BlockingDeque import. The executor override is written only through setBlockingTaskExecutorOverride.
   
   @DanielLeens — the close-once finding on `7246ffc847` is addressed on `4083d330a2`.
   
   The DONE branch no longer calls `task.close()` again after the task already closed itself. `Task.resourcesClosed()` / `AbstractTask.beginClose()` is the one close claim shared by the task lifecycle (`SeaTunnelTask` CLOSED/CANCELLING, the enumerator, and the aggregated committer) and `closeTaskAfterRollbackIfNeeded`. A task that returns DONE without closing is still closed once by rollback.
   
   Regression: `testCooperativeDoneAfterOwnCloseIsNotClosedAgain`. The cooperative `call()` closes itself and returns DONE while the group exception is already set. The test asserts one close in total and that the generation's classloader references are released.
   
   Local `TaskExecutionServiceTest` 34/34. CI: https://github.com/Rangsh/seatunnel/actions/runs/46577345130 on `4083d330a2` (queued).


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 @DanielLeens Re-ran the failed/cancelled jobs on the same head (`fee6db3b3c`) via `--failed` on [Rangsh/seatunnel run 34558932185](https://github.com/Rangsh/seatunnel/actions/runs/34558932185). Results:
   
   | Job | Before | After `--failed` rerun | Notes |
   |---|---|---|---|
   | `transform-v2-it-part-1 (11)` | failure | **success** | Confirmed flake — previous failure was `TestFilterRowKindIT.testFilterRowKindMultiTable`; green on rerun |
   | `all-connectors-it-2 (8)` | failure | failure again | Unrelated infra — see below |
   | `paimon-connector-it (11)` | cancelled | failure | Unrelated infra — see below |
   
   **Remaining failures (same root cause, unrelated to this PR):**
   
   1. [`all-connectors-it-2 (8)`](https://github.com/Rangsh/seatunnel/actions/runs/34558932185/job/103669088264) — `IcebergSourceIT.startUp`  
      `ContainerFetchException: Can't get Docker image: minio/minio:RELEASE.2024-06-13T22-53-53Z`  
      Cause: `Status 404: pull access denied for minio/minio ... requested access to the resource is denied`
   
   2. [`paimon-connector-it (11)`](https://github.com/Rangsh/seatunnel/actions/runs/34558932185/job/103669088312) — `PaimonWithS3IT.startUp`  
      Same `minio/minio` Docker Hub pull denial at startup (before any Paimon/engine logic under test). Other Paimon ITs in the same job passed (`PaimonIT`, `PaimonSinkCDCIT`, `PaimonStreamReadIT`, etc.).
   
   Neither failure path touches `TaskExecutionService` / the post-publish rollback this PR changes. The transform job that previously failed is now green on the same commit, which further supports these as pre-existing / infra flakes rather than regressions from this diff.
   
   Overall on this head after the rerun: **77 success / 14 skipped / 2 failure** (both MinIO image-pull). Please take another look for merge when convenient.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   CI update on head `34a4364a85` (synced with latest `dev`):
   
   - Fork **Build** is green: https://github.com/Rangsh/seatunnel/actions/runs/44870098758 (all jobs success after re-run; the earlier `connector-redis-it (17)` failure was Maven Wrapper download 404 before any tests ran — unrelated to this diff).
   - Local: `TaskExecutionServiceTest` — 27/27 pass on this head.
   
   Prior review threads ( @DanielLeens , @SEZ9 ) already treated the code as ready; no open source blockers on the PR-owned files (#12164 post-publish rollback in `TaskExecutionService`).
   
   Could @davidzollo @nzw921rx or another committer with write access please take a look for **formal approve / merge**? Thanks!


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 — thanks for [#7262794462](https://github.com/apache/seatunnel/pull/12218#issuecomment-7262794462). Reposting the cut-off row and the seven statuses below. Paths 1–2 and the cooperative `taskDone` notes are in [#7256613150](https://github.com/apache/seatunnel/pull/12218#issuecomment-7256613150).
   
   **Head for follow-up:** `7246ffc847` (Daniel Issues 3/4/7/8: loader teardown, after-dequeue test gate, test executor shutdown — on top of `54f42174d0`). Local `TaskExecutionServiceTest` **33/33**.
   
   **CI (fork, re-run):** [Rangsh/seatunnel run 46275103984](https://github.com/Rangsh/seatunnel/actions/runs/46275103984) on `7246ffc847` — other jobs **success**; `engine-v2-it (11, ubuntu-latest)` still **running** (re-run after the earlier unrelated `RestApiIT.testGetLog` failure). Will comment again if that job fails.
   
   ---
   
   **Drop path 3 (cancelled before start)**
   
   | Path | Test | Assertion |
   |------|------|-----------|
   | **Cancelled before start** | `testRollbackAccountsBlockingCancelledBeforeWorkerStarts` | `assertFailedGenerationAccounting(service, location, 3)`; `PartialSubmitProbeTask.enteredCall(11L)` and `enteredCall(12L)` are **false** |
   
   **Drop paths 1–2:** `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection` — never-submitted **4L** (`enteredCall(4L)` false, `assertFailedGenerationAccounting(..., 4)`); cooperative **1L** removed from queue (`threadShareQueueContainsLocation` false), same accounting **4**.
   
   **Cooperative `taskDone` (post-cut-off):** rollback calls `taskDone` via dropped-task accounting when the worker never owns **RUNNING**; when **RUNNING**, rollback does not `taskDone`/`close()` during an active `call()` — the worker accounts once (see `testRollbackDoesNotCloseCooperativeTaskDuringCall` on `7246ffc847`).
   
   ---
   
   **Earlier points — status**
   
   | Point | Status |
   |-------|--------|
   | `deployLocalTask` Javadoc (post-publish rollback vs pre-publish exceptional completion) | **Done** — on/before `54f42174d0`; unchanged on `7246ffc847` |
   | Callback rollback test: cleanup in `finally`; static stop on deserialized task (`ExecutionMarkerTask`) | **Done** — `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy` (`54f42174d0` tree) |
   | PR description: `TaskGroupContext` (`claimJarsForClassLoaderRelease`, volatile fields) | **Done** — PR body |
   | `TaskGroupContext`: no bypass setters; `jars` volatile | **Done** — `@Setter(AccessLevel.NONE)` on `classLoaders` and `jars`; `jars` is `volatile` (`54f42174d0` tree) |
   | Assertions in overridden `submit()` vs production `catch (Throwable)` | **Done** — gate outcomes in `AtomicBoolean`, asserted on the test thread after deploy returns |
   | Partial-submit: rejecting executor + PART before `try`/`finally` | **Done** — override + thread-share mode set before the outer `try`; rejecting executor cleared and `ThreadShareMode` restored in `finally` |
   | Test helper cleanup (`callCount()`, FQCN, executor override) | **Done** on `54f42174d0` — shared `setBlockingTaskExecutorOverride`, no `callCount()`; `7246ffc847` adds after-dequeue gate + executor shutdown in test `finally` (Daniel test hygiene) |
   
   Please use **`7246ffc847`** for your follow-up pass when convenient. Thanks.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @DanielLeens — addressing **Issue 3 / 4 / C1 / 5 / 6** on the next push (local head, not yet on fork):
   
   | Item | Status | What changed |
   |------|--------|----------------|
   | **Issue 3** | Fixed | `taskLifecycle` PENDING→RUNNING/DROPPED; `registerAllDeploymentTasks` before `onContextPublished`; blocking/cooperative gates + tests: no init/call after drop, no close during active `call()` |
   | **Issue 4** | Fixed | `testRollbackSurvivesCooperativeCloseFailureAndAllowsRedeploy` uses `cooperativeWorkerPollGateForTests` (no sleep / no instant `stop=true` DONE) |
   | **C1** | Fixed | Full inventory at register time; dropped paths call `accountDroppedTask` → `close` + `taskDone`; callback failure test asserts `assertFailedGenerationAccounting(..., 1)` |
   | **Issue 5** | Fixed | `suppressCleanupFailure` + `testSuppressCleanupFailureSkipsSelfSuppression` |
   | **Issue 6** | Fixed | Field/method comments in `TaskExecutionService`; PR description updated to **33** Surefire executions + test list |
   
   Local: `./mvnw -pl seatunnel-engine/seatunnel-engine-server -Dtest=TaskExecutionServiceTest verify` — **33/33** pass.
   
   Will push shortly for re-review on CI.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @DanielLeens @SEZ9 — **single consolidated reply** on pushed head [`54f42174d0`](https://github.com/Rangsh/seatunnel/commit/54f42174d0). Yes, contributing to **Apache SeaTunnel**.
   
   **CI:** fork Build queued/running for this SHA — https://github.com/Rangsh/seatunnel/actions/runs/46267608955  
   **Local:** `./mvnw -pl seatunnel-engine/seatunnel-engine-server -Dtest=TaskExecutionServiceTest verify` — **33/33** pass.
   
   ---
   
   ## Daniel — blocking items (Issues 3, 4, C1, 5, 6)
   
   | Item | Status on `54f42174d0` | Evidence |
   |------|------------------------|----------|
   | **Issue 3** — atomic rollback vs worker ownership (`PENDING`→`RUNNING`/`DROPPED`); register before publish; latch tests | **Fixed** | `taskLifecycle` + `tryMarkRunning` / `tryMarkDropped`; `registerAllDeploymentTasks` before `onContextPublished`; gates: `testRollbackMarksDroppedBeforeBlockingOwnershipClaim`, `testRollbackOwnershipDroppedBlockingSkipsCallAfterClaimGate`, `testRollbackDoesNotCloseCooperativeTaskDuringCall` |
   | **Issue 4** — cooperative close-failure test scheduling | **Fixed** | `testRollbackSurvivesCooperativeCloseFailureAndAllowsRedeploy` + `cooperativeWorkerPollGateForTests`; `CloseThrowingCooperativeTask` without instant `stop=true` DONE |
   | **C1** — full task inventory; latch/`taskDone` on failed publish | **Fixed** | `registerAllDeploymentTasks` pre-publish; `accountForTasksDroppedAfterRollback` / `accountDroppedTask`; workers already **RUNNING** finish via worker `taskDone` (not rollback double-count); `assertFailedGenerationAccounting` on callback failure (`…PostPublishFailure…`, expect **1**) |
   | **Issue 5** — `addSuppressed` self-suppression | **Fixed** | `suppressCleanupFailure` + `testSuppressCleanupFailureSkipsSelfSuppression` |
   | **Issue 6** — field/method contract comments + PR test inventory | **Fixed** | Tracker Javadoc on lifecycle/accounting; PR description lists `TaskGroupContext` scope + **33** Surefire executions and new tests |
   
   ---
   
   ## SEZ9 — dropped paths → tests (Issue 1 / accounting thread)
   
   | Drop path | Test | Assertion |
   |-----------|------|-----------|
   | **1. Never submitted blocking** (index `>= blockingFutures.size()`) | `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection` | `assertFailedGenerationAccounting(..., 4)`; `PartialSubmitProbeTask` **4L** never enters `call()` |
   | **2. Cooperative removed from `threadShareTaskQueue`** | Same partial-submit test (task **1L** `threadsShare=true` enqueued then drained on rollback) + `testRollbackSurvivesCooperativeCloseFailureAndAllowsRedeploy` | partial: queue empty + latch **4**; close-failure: `assertFailedGenerationAccounting(..., 1)` + exactly one `close()` attempt |
   | **3. Cancelled before worker RUNNING** | `testRollbackAccountsBlockingCancelledBeforeWorkerStarts` | `assertFailedGenerationAccounting(..., 3)`; tasks **11L/12L** never enter `call()` |
   
   **`taskDone` on rollback deploy thread:** only when `tryMarkDropped` wins (**paths 1–2** above via `accountDroppedTask`).
   
   **`taskDone` *not* called on rollback:** when worker already owns **RUNNING** — `tryMarkDropped` returns false; worker reports `taskDone` in `BlockingWorker` `finally` / cooperative loop (generation size unchanged because worker still counts that id once). Rollback does **not** `close()` a cooperative task during active `call()` (`testRollbackDoesNotCloseCooperativeTaskDuringCall`).
   
   ---
   
   ## SEZ9 — earlier review bullets (non-blocker; one-line status)
   
   | Point | Status on `54f42174d0` |
   |-------|------------------------|
   | `deployLocalTask` Javadoc (post-publish FAILED vs pre-publish exceptional) | **Fixed** — method Javadoc in `TaskExecutionService` |
   | `submitBlockingTask` Javadoc (mid-batch rethrow without `startedLatch`) | **Fixed** |
   | Callback-side rollback test cleanup / static stop | **Fixed** — `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy` + `ExecutionMarkerTask` + `finally` |
   | PR description mentions `TaskGroupContext` / volatile / claim-once | **Fixed** — PR body updated for this head |
   | `TaskGroupContext` setters bypass / `jars` volatile | **Fixed** — `@Setter(AccessLevel.NONE)` on `classLoaders` and `jars`; `jars` is `volatile` |
   | Assertions inside overridden `submit()` | **Fixed** — `firstBlockingCallGateSatisfied` / `TimedOut` asserted on test thread after deploy returns |
   | Partial-submit: executor + PART mode before `try`/`finally` | **Fixed** — setup at start of `try`, restore in `finally` |
   | Test helper cleanup | **Fixed** — shared `setBlockingTaskExecutorOverride`; removed unused `callCount()` |
   
   Please re-review on CI when green. Thanks.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh thanks for the clear status at `4083d330a2`. What you describe lines up with what the five points asked for. Since this is a description rather than a diff, I'd like to confirm each one against the code before treating it as resolved, so yes please to the exact lines:
   
   1. **Rollback and `taskDone`:** `registerAllDeploymentTasks`, `accountForTasksDroppedAfterRollback`, and the `assertFailedGenerationAccounting` calls in the three tests you listed.
   2. **`deployLocalTask` Javadoc:** the text covering both the post-`contextPublished` and the pre-publication contract.
   3. **Callback-side rollback test:** the `finally` cleanup, and the static `STOP` with `reset()` / `requestStop()` in `ExecutionMarkerTask`.
   4. **PR description:** no lines needed; I'll compare the updated scope with the diff.
   5. **`TaskGroupContext`:** the `AccessLevel.NONE` setter annotation and `volatile` on `classLoaders` and `jars`.
   
   Three smaller test-side points from the earlier review are not in your update. Could you say where each stands?
   
   - **Assertions inside the overridden `submit()`:** They were swallowed by the production `catch (Throwable)` they are meant to guard. Are they now captured and asserted outside it?
   - **Partial-submit test setup:** The rejecting executor and PART mode were installed on the shared server before entering `try`/`finally`. Has that setup moved inside the guarded block?
   - **Test helper cleanup:** Three things were open: the unused `callCount()` accessor, the inline fully-qualified type, and the executor override being set two different ways.
   
   A short "done" or "not yet" for each is enough.
   
   <!-- streview-comment:2788 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @Rangsh for going through both failure logs on fork run 38496659794 (head `35f5a2fcf7c`). Your reading matches what I see:
   
   - `engine-v2-it (11)` (job 115650597710) is still the known `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` cancel-vs-worker-loss race (`expected: <CANCELED> but was: <FAILED>`). It does not go through a failed `deployLocalTask`, and #12311 is not on `dev` yet, so no action from this PR will clear it. Not a blocker here.
   - `kafka-connector-it (17)` (job 115650597797) fails only in the Testcontainers image build (`received unexpected HTTP status: 500 Internal Server Error`) before any Kafka test logic runs, and the same test passes for the other engine parameters in that job. That is a registry/runner flake, unrelated to this change.
   
   Since the head has not moved since `35f5a2fcf`, this is a follow-up rather than a fresh review, and I agree no speculative source patch is wanted for either failure.
   
   Remaining asks, both small:
   1. When you next sync the branch with `dev`, please post the new fork run link so we can confirm `kafka-connector-it (17)` goes green on a clean build. No need to do it just for that; whenever your next push happens is fine.
   2. Nothing else on the source side from this round. Once that run is in, this is ready for committer approval and merge.
   
   Thanks for the patience across these iterations.
   
   <!-- streview-comment:1900 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh Thanks, that matches my read of the thread — no further source change is needed from you for this fix.
   
   To confirm where things stand on head `35f5a2fcf7c9ad52f25f07d299a2f918925ebd19`:
   
   - `engine-v2-it (11)` (job 115650597710): the `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck` cancel-vs-worker-loss race does not go through the changed `deployLocalTask` path, and since #12311 is still open, a `dev` sync alone will not clear it. We will keep treating it as unrelated to this PR.
   - `kafka-connector-it (17)` (job 115650597797): the `received unexpected HTTP status: 500 Internal Server Error` from the Testcontainers image build happens before any Kafka test logic runs, so it is a registry/runner flake, not something this PR introduced.
   
   Remaining items:
   
   1. Whenever you next push (e.g. a sync with `dev`), that will give us a fresh fork run for the Kafka lane. If `KafkaIT.testNativeSinkKafka` then fails on an executed assertion rather than the image build, please post the new job link here as you offered; otherwise a green Kafka lane is all we need from that job.
   2. Once CI on the final head is acceptable, the remaining gate is a write-capable maintainer's approval. As a read-only reviewer I cannot do the formal approval, but there is nothing more for you to do there.
   
   Thanks for the careful log reading and the patience across these rounds.
   
   <!-- streview-comment:1965 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   **Follow-up** — code is now on fork at **`54f42174d0`**. Re-read comments [#7256481488](https://github.com/apache/seatunnel/pull/12218#issuecomment-7256481488) / [#7256481710](https://github.com/apache/seatunnel/pull/12218#issuecomment-7256481710) against this SHA; one correction below.
   
   @DanielLeens — the earlier table still applies on `54f42174d0`. Mapping to your blocking items:
   - **Issue 3:** `taskLifecycle` + `tryMarkRunning` / `tryMarkDropped`; `registerAllDeploymentTasks` **before** `onContextPublished` (line order in `deployLocalTask`); test gates on before-claim / after-claim / cooperative poll; `testRollbackDoesNotCloseCooperativeTaskDuringCall`.
   - **Issue 4:** cooperative close-failure test gates dequeue with `cooperativeWorkerPollGateForTests`; `CloseThrowingCooperativeTask` no longer instant-DONE via `stop=true`.
   - **C1:** full id inventory at register time; `accountForTasksDroppedAfterRollback` + `accountDroppedTask` for tasks that will not self-`taskDone`; blocking/cooperative workers that already own **RUNNING** still finish via worker `finally` / loop `taskDone` (see tracker Javadoc on `accountForTasksDroppedAfterRollback`).
   - **Issue 5 / 6:** as in prior comment; PR description lists **33** Surefire executions.
   
   @SEZ9 — **correction to [#7256481710](https://github.com/apache/seatunnel/pull/12218#issuecomment-7256481710):** the opening line “all three paths via `accountDroppedTask` → `taskDone`” was imprecise.
   
   | Path | `taskDone` owner | `close` on rollback deploy thread? |
   |------|------------------|-----------------------------------|
   | **1. Never reached RUNNING** (queue removed / cancelled future / unvisited tail) | rollback: `accountDroppedTask` → `close` + `taskDone` | yes (when drop CAS wins) |
   | **2. DROPPED wins before RUNNING** | rollback: `accountDroppedTask`; worker returns after failed `tryMarkRunning` **without** `taskDone` | yes |
   | **3. Worker already RUNNING** | **worker** (`taskDone` in `finally` / cooperative loop); `tryMarkDropped` returns false so rollback does **not** double-count | rollback **does not** `close()` while cooperative is in `call()`; worker may `close` after abort |
   
   `taskDone` is **skipped** on rollback only when `tryMarkDropped` loses to **RUNNING** (worker still owns completion).
   
   Please re-review `54f42174d0` on CI when green.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 @DanielLeens @zhangshenghang — follow-up on the dropped-task / lifecycle review items, addressed on **`e778df2e24`**.
   
   ## Production (`TaskExecutionService`)
   
   1. **Full blocking batch registered up front** — `registerExpectedBlockingTasks(tasks)` runs before the submit loop, so a mid-batch rejection still accounts for **unvisited tails** (e.g. task `4L` in partial-submit).
   2. **Do not `taskDone` running blocking workers early** — `markBlockingWorkerEnteredRun` is set when `BlockingWorker.run()` starts; `accountForTasksDroppedAfterRollback` skips those ids instead of treating `isCancelled() && isDone()` on an interrupted but still-unwinding future as “never started”.
   3. **Cooperative teardown on rollback** — queued cooperative trackers removed from `threadShareTaskQueue` are `close()`d (with task classloader) before `taskDone`; cooperative workers on rollback / interrupt paths call the same close helper; a final sweep closes initialized cooperative tasks that are not running on a cooperative worker and not yet `taskDone`.
   
   ## Tests (`TaskExecutionServiceTest`, now **28** tests)
   
   | Case | Test / assertion |
   |------|------------------|
   | Unvisited blocking tail + failed generation completes | `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection` — **4 tasks**, `awaitFailedGenerationTerminalState` → **FAILED**, tail `4L` never enters `call()` |
   | Cancelled before `BlockingWorker` starts + tail reject | **New** `testRollbackAccountsBlockingCancelledBeforeWorkerStarts` — single-thread pool, tasks `10L/11L/12L`, direct terminal **FAILED** |
   | (Cooperative close) | Covered in production paths above; reliable deterministic close assertion is still hard when the buswork dequeues immediately — happy to add if you want a narrower unit harness |
   
   Local: `TaskExecutionServiceTest` **28/28**; `spotless:apply` + module `verify` on this head.
   
   Issues **2–8** from earlier rounds remain as on `e3a9b8eb` (Javadoc, `TaskGroupContext` setters, test hygiene, PR description) — unchanged in this commit beyond the accounting/close fixes above.
   
   Fork Build will re-run on push. Thanks again for the detailed review.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh thanks for the follow-up on `e778df2e24`. Going by your description (I have not re-checked the code yet), the three production changes line up with the three drop paths behind the dropped-task finding:
   
   - **Never submitted:** `registerExpectedBlockingTasks(tasks)` runs before the submit loop, so an unvisited tail after a mid-batch rejection is still accounted for.
   - **Cancelled before start:** `markBlockingWorkerEnteredRun` lets `accountForTasksDroppedAfterRollback` skip workers that are still unwinding, instead of treating `isCancelled() && isDone()` as "never started".
   - **Removed from the cooperative queue:** trackers removed from `threadShareTaskQueue` are `close()`d before `taskDone`, with a final sweep for initialized cooperative tasks.
   
   As described, that is what the finding asked for: the rolled-back tracker should be able to complete on its own.
   
   A few things I still need:
   
   1. **Test table:** I can only see the start of the first row ("Unvisited blocking tail + failed generation c"). Could you repost it, so I can see which test covers each of the three drop paths?
   2. **`deployLocalTask` Javadoc:** does it now document the post-publish rollback and its different completion mode, not only the pre-publication failure contract?
   3. **PR description:** has it been updated to say that `TaskGroupContext` also changes (a new public method and a `volatile` field)?
   4. **`TaskGroupContext`:** the class-level Lombok setter annotation still lets `setClassLoaders`/`setJars` bypass the claim-once invariant, and `jars` is not `volatile` while `classLoaders` is. Has this changed, or is it intentionally left?
   5. **`TaskExecutionServiceTest`:** what is the status of each of these?
      - The callback-side rollback test cleans up outside `finally`, and its `stop.set(true)` has no effect on the deserialized task.
      - Assertions inside the overridden `submit()` are swallowed by the production `catch (Throwable)`.
      - The partial-submit test installs the rejecting executor and PART mode before entering its `try`/`finally`.
      - The helpers leave an unused `callCount()` accessor, use an inline fully-qualified type, and set the executor override two different ways.
   
   A one-line status per item (fixed on `e778df2e24`, or deliberately left with the reason) is enough.
   
   <!-- streview-comment:2581 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @DanielLeens. Both non-blocking items are addressed in `ea8fb3c38`.
   
   **Issue 1:** `testAllBlockingDeployFailureAfterWorkersStartedCompletesAsFailed` no longer releases the workers from the test body. They stay blocked in `call()` until rollback's `cancel(true)` interrupts them, then return `DONE`. The countdown remains only in `finally` for cleanup, so `taskDone` cannot observe a clean completion before the deploy failure is recorded.
   
   **Issue 2:** `rollbackPublishedDeployment` now wraps `abortAfterFailedPublish` the same way as the classloader release. If cancellation throws anything other than the `CancellationException` already swallowed inside `cancelAllTask()`, the failure is added as suppressed and logged, and the stale `executionContexts` removal still runs.
   
   `TaskExecutionServiceTest` is green locally (27 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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @Rangsh - I checked this mapping against the actual test file at the current head (`fee6db3b3c`, unchanged since my last review) rather than just taking the summary at face value, and it's accurate:
   
   - `TaskExecutionServiceTest.java:528` (`testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy`): redeploy assertion at line 586 calls `taskExecutionService.deployTask(redeployData)`.
   - `TaskExecutionServiceTest.java:613` (`testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection`): redeploy assertion at line 746 also calls `taskExecutionService.deployTask(redeployData)`, with the inline comment at 743-745 explicitly calling out that this is deliberate so the assertion exercises the same `executionContexts.containsKey` skip branch in `deployTask(TaskGroupImmutableInformation)` that #12164 is about.
   
   Both go through `deployTask(Data)`, not the internal `deployLocalTask`, so both hit the real production skip-check rather than bypassing it - this matches what I independently traced and confirmed as resolved in my last review (Issue 1 in that round). Nothing new on the code side; both-sides checklist mapping is correct.
   
   One thing worth closing the loop on: the fork run for this exact head (`Rangsh/seatunnel` run `34558932185`) has since completed with `conclusion: failure` - `transform-v2-it-part-1 (11)` and `all-connectors-it-2 (8)` failed, and `paimon-connector-it (11)` was cancelled. None of these are topically related to `TaskExecutionService`/the rollback path this PR touches (no transform-v2, all-connectors, or paimon code is in this diff), so I don't have a reason to think this PR caused them, but I hadn't seen a completed result on this head when I last reviewed (it was still queued). Worth a rerun/check before a maintainer merges, just so the CI condition I flagged as the remaining item is actually closed out with a real green (or confirmed-unrelated) result rather than left at "queued."
   
   No open code-level findings from me on this 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: [PR] [Fix][Zeta] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 status at `4083d330a2` for the five points. Nothing in this comment changes the code.
   
   1. **Rollback and `taskDone`:** Done. Dropped tasks are counted, so the rolled-back tracker can complete. `registerAllDeploymentTasks` runs before publish. `accountForTasksDroppedAfterRollback` calls `taskDone` for tasks removed from the cooperative queue, cancelled before start, or never submitted. A RUNNING worker reports `taskDone` itself. `assertFailedGenerationAccounting` checks latch 0 and the done count: `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection` (4), `testRollbackAccountsBlockingCancelledBeforeWorkerStarts` (3), `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy` (1).
   
   2. **`deployLocalTask` Javadoc:** Done. After `contextPublished`, failure runs `rollbackPublishedDeployment` and completes `FAILED`. Before publication it still uses `completeExceptionally(t)`.
   
   3. **Callback-side rollback test:** Done. `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy` puts cleanup in `finally`. The old per-instance `stop.set(true)` is gone. `ExecutionMarkerTask` uses a static `STOP`, `reset()` before redeploy, and `requestStop()` in `finally`.
   
   4. **PR description:** Done. The scope lists `TaskGroupContext.java`, the public method `claimJarsForClassLoaderRelease()`, and `classLoaders` / `jars` as `volatile` with `@Setter(AccessLevel.NONE)`.
   
   5. **`TaskGroupContext`:** Done. The class-level setter cannot bypass claim-once. Both `classLoaders` and `jars` have `@Setter(AccessLevel.NONE)`, and both are `volatile`.
   
   Happy to point at the exact lines if useful.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @DanielLeens. I checked the finished fork run for head `35f5a2fcf` (https://github.com/Rangsh/seatunnel/actions/runs/38496659794): 79 jobs green, 13 skipped, 2 failed. I cannot rerun a single failed job from the fork (`gh run rerun --failed` returns "run ... cannot be rerun"), so I read both failure logs instead.
   
   1. `engine-v2-it (11)` (https://github.com/Rangsh/seatunnel/actions/runs/38496659794/job/115650597710) is still exactly the one you identified: `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck`, `expected: <CANCELED> but was: <FAILED>`. It does not go through a failed `deployLocalTask`, and the fix (#12311) is still not on `dev`, so I am treating it as the known unrelated cancel-vs-worker-loss race.
   
   2. One job was still running when you reviewed and has since failed: `kafka-connector-it (17)` (https://github.com/Rangsh/seatunnel/actions/runs/38496659794/job/115650597797). The only error is `KafkaIT.testNativeSinkKafka`, and it is not an assertion failure. The same test passed for the other engine parameters in that job; the one error is `ParameterResolutionException: Could not build image: received unexpected HTTP status: 500 Internal Server Error` from the Testcontainers image build. This PR does not touch Kafka or any container image, so I believe this is a runner/registry flake rather than a result of this change.
   
   No source change from this round. Happy to paste more of either log if it would help, and thank you again for staying with this.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @DanielLeens. Agreed that this is a CI gate rather than a source change, so I have not touched the three files this PR owns.
   
   I synced the latest `upstream/dev` (`25bcc53fd`, which includes the Cassandra fix `07d6f223` / #12756) into this branch as `35f5a2fcf`. The merge was clean, and the branch is now ahead 11 / behind 0 relative to `dev`.
   
   The fork `Build` for that head is running now: https://github.com/Rangsh/seatunnel/actions/runs/38496659794
   
   I will report back on `all-connectors-it-2` (Cassandra), `all-connectors-it-6` (Databend) and `engine-v2-it` (`SplitClusterFaultToleranceIT`) once they finish. If either of the last two is still red after this sync, I will paste the failing job link here so you can help narrow it down. Thank you again for the careful review.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @SEZ9 and @Rangsh. Agreed on keeping the registry failure and the cancel-versus-worker-loss race separate from this deploy rollback fix. There is no new source request from my side. The cancellation correction #12311 is still open, so syncing current `dev` alone is not a demonstrated cure for that race. A targeted retry of the registry-failed Kafka job after registry availability recovers is useful; please retain the new job link if an executed assertion then fails. CI on the final head and a write-capable maintainer approval remain the merge gates. I have not rerun any workflow or performed another full code review in this follow-up.
   
   Status evidence: head `35f5a2fcf7c9ad52f25f07d299a2f918925ebd19`, base `dev`, compare `diverged`, ahead 11, behind 80; GitHub mergeable state `blocked`.
   


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh thanks for the detailed write-up.
   
   **Dropped-task accounting (Medium)**
   
   From your description, the approach in `0b242a3271` addresses the point:
   
   - `registerExpectedBlockingTasks` runs before the blocking submit loop.
   - `accountForTasksDroppedAfterRollback` runs on rollback, including the cooperative trackers removed from `threadShareTaskQueue`.
   - `assertFailedGenerationAccounting` checks `completionLatchRemainingForTests() == 0` and `tasksReportedDoneCountForTests()` against the expected generation size.
   
   This is based on your description only, and I need two things before closing it:
   
   1. Your comment reached me cut off partway through the "Never submitted" row of the drop-path table. Could you repost the table? For each of the three paths (never submitted, removed from the cooperative queue, cancelled before start), I need the test name and the assertion that proves it.
   2. You wrote "`close()` + `taskDone` where applicable" for the cooperative trackers. In which case is `taskDone` not called, and how is that task still counted towards the expected generation size?
   
   **Other points from the previous review**
   
   The part of your comment I received does not cover these, so please give a one-line status for each (fixed in `0b242a3271`, or intentionally left with a reason):
   
   - **`deployLocalTask` Javadoc:** it should document the post-publish rollback and its different completion mode.
   - **Callback-side rollback test:** cleanup sits outside `finally`, and `stop.set(true)` has no effect on the deserialized task.
   - **PR description:** it should mention the `TaskGroupContext` changes (the new public method and the `volatile` field).
   - **`TaskGroupContext` setters:** the class-level setter annotation lets `setClassLoaders`/`setJars` bypass the claim-once invariant, and `jars` is not `volatile` while `classLoaders` is.
   - **Assertions inside the overridden `submit()`:** they are swallowed by the production `catch (Throwable)`.
   - **Partial-submit test:** the rejecting executor and PART mode are installed on the shared server before the `try`/`finally`.
   - **Test helper cleanup:** the unused `callCount()` accessor, the inline fully-qualified type, and the two different ways of setting the executor override.
   
   <!-- streview-comment:2629 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh thanks for the breakdown, this answers my question for the part I can see.
   
   - **Post-publish failure test:** agreed. As you describe it, `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy` fails before any cooperative or blocking submit, so it doesn't count as coverage for the three dropped `taskDone` cases.
   - **Case (1), cooperative task removed from `threadShareTaskQueue`:** by your own table this is covered indirectly only. The listed assertions check the cleanup side effects, but none of them observes the rolled-back tracker/generation completing, which was the original concern.
   - **Cases (2) and (3):** your comment reached me cut off partway through row (1), so I can't see the rows for the blocking task cancelled before start or the task that was never submitted. Could you repost those two rows?
   
   Remaining asks on this point:
   
   1. Add a direct assertion in `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection` that the rolled-back tracker/generation completes, so the test fails if `accountForTasksDroppedAfterRollback` stops counting a dropped task.
   2. Make sure each of the three dropped cases is covered by such an assertion. If (2) or (3) is also indirect only today, please extend the test or add a focused one.
   
   This comment only covers the dropped-task accounting. Could you also confirm where the other earlier review points stand on `e3a9b8eb`: the `deployLocalTask` Javadoc, the PR description, the `TaskGroupContext` setters, and the test cleanup/style items?
   
   <!-- streview-comment:2552 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh thanks for the update on `54f42174d0`, the local `TaskExecutionServiceTest` 33/33 figure and the run link (46267608955).
   
   **Dropped-task accounting (Medium)**
   
   As you describe it, the change targets the concern that a rolled-back tracker could never complete on its own: `registerExpectedBlockingTasks` before the blocking submit loop, `accountForTasksDroppedAfterRollback` on rollback (including cooperative trackers removed from `threadShareTaskQueue`), and `assertFailedGenerationAccounting` checking the latch and the done count against the expected generation size.
   
   Thanks for the drop-path table. Two of the three paths are clear:
   
   - **Never submitted:** `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection`, with `assertFailedGenerationAccounting(..., 4)` and `PartialSubmitProbeTask.enteredCall(4L)` false.
   - **Removed from the cooperative queue:** the same test, with `threadShareQueueContainsLocation(..., location)` false and the same accounting assertion.
   
   Your comment reaches me cut off at the "Cancelled befor" row, so I can't see the third path or anything after it. This point stays open on my side until I have that row.
   
   **What I still need**
   
   1. The test name and assertion for the cancelled-before-start path. Please re-post that row and anything that followed it.
   2. A short status (done, or not done and why) for each of the other earlier points, if the cut-off part didn't already cover them:
      - The `deployLocalTask` Javadoc should describe the post-publish rollback and its different completion mode.
      - The callback-side rollback test cleans up outside `finally`, and its `stop.set(true)` has no effect on the deserialized task.
      - The PR description should mention the `TaskGroupContext` changes (a new public method and a `volatile` field).
      - The class-level setter annotation on `TaskGroupContext` lets `setClassLoaders`/`setJars` bypass the claim-once invariant, and `jars` is not `volatile` while `classLoaders` is.
      - Assertions inside the overridden `submit()` are swallowed by the production `catch (Throwable)`.
      - The partial-submit test installs the rejecting executor and PART mode on the shared server before its `try`/`finally`.
      - Test helper cleanup: the unused `callCount()` accessor, the inline fully-qualified type, and the executor override being set two different ways.
   
   Once I have the missing row and those statuses, I'll do the follow-up pass on `54f42174d0`.
   
   <!-- streview-comment:2711 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 **CI update:** Fork [run 46275103984](https://github.com/Rangsh/seatunnel/actions/runs/46275103984) on `7246ffc847` — **success**, all jobs green (re-run after the earlier unrelated `engine-v2-it (11)` / `RestApiIT.testGetLog` failure).


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh thanks. I have no further questions on the points you linked. The check of the unchanged `b41db8fc56213` source already covered them, and that technical conclusion on the current head stands. The final independent maintainer review is still open.
   
   <!-- streview-comment:2816 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @Rangsh for turning around the reruns so quickly, and @SEZ9 for pushing to get this fully closed out.
   
   I independently pulled both remaining failure logs on this exact head (`fee6db3b3c`, fork run `34558932185`) rather than taking the summary at face value:
   - `all-connectors-it-2 (8)` fails in `IcebergSourceIT.startUp` with `com.github.dockerjava.api.exception.NotFoundException: Status 404: pull access denied for minio/minio, repository does not exist or may require 'docker login'`.
   - `paimon-connector-it (11)` fails in `PaimonWithS3IT.startUp` with the identical `minio/minio` 404 pull-denial, also at container bootstrap.
   
   Both fail before any Iceberg/Paimon test logic runs, let alone anything touching `TaskExecutionService` - they're hitting the ongoing Docker Hub removal of the `minio/minio` repository that's been showing up across unrelated PRs recently, not something this diff could cause. I also checked whether there's an upstream fix to rebase onto: apache/seatunnel#12287 ("Switch minio/minio test containers to the quay.io mirror") is still open and unmerged as of now, so there's no sync available yet that would clear this - it'll need that PR (or an equivalent fix) to land in `dev` first. Given that, I agree these two should be treated as pre-existing infra failures rather than chased with any change in this PR, and `transform-v2-it-part-1 (11)` going green on rerun confirms that one was the flake it looked like.
   
   Combined with Issue 1 (partial-submission rollback) and Issue 2 (`CooperativeTaskWorker` guard) both resolved and verified in earlier rounds, and the both-sides test mapping confirmed against the actual test file, I don't have anything left blocking this PR on the code or CI side.
   
   One item worth flagging while we're here since it affects mergeability directly: the PR is currently showing `CONFLICTING`/`DIRTY` against `dev` (it's 66 commits behind), so a rebase will be needed before a maintainer can merge regardless of the CI item above.
   
   As I only have comment-only review rights on this repo, a maintainer with write-level review permission should give the formal approve/merge - from my side this is ready to merge once the branch is rebased.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 Mapping for the both-sides checklist item from #12164 (also added as a dedicated section in the PR description):
   
   | Side | Injection point | Test |
   |------|-----------------|------|
   | **Callback side** | `onContextPublished` throws after publication | `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy` |
   | **Submission side** | `submitBlockingTask` / `RejectedExecutionException` after partial submit | `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection` |
   
   Both redeploy assertions go through `deployTask(Data)` (not `deployLocalTask`), so they hit the `executionContexts.containsKey` skip branch that #12164 describes, and each asserts cleanup + real re-execution for the same `TaskGroupLocation`.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @DanielLeens Thank you for another thorough from-scratch review, and for tracing the `testCriticalCallTime` / `testDelay` failures to the exact cause. You were right: the null-check I added in `4de899d4e` conflated "context rolled back" with "this task has no classloader entry".
   
   **Issue 1 (High): fixed in `36d911bd6`**
   
   - `BlockingWorker.run()` and `CooperativeTaskWorker.run()` now read `taskGroupContext.getClassLoaders()` once and treat only a `null` **map** as a rolled-back context. That is exactly what `claimJarsForClassLoaderRelease()` clears. A missing per-task entry falls through to the original behavior: the task runs, and `setContextClassLoader` receives `null` as it did before this PR.
   - Reading the map into a local once also keeps the NPE window closed: a concurrent claim can't null it between the check and the `get(taskId)`.
   - `TaskGroupContext.classLoaders` is now `volatile`, so workers reliably see the rollback thread's clear. The Javadoc now documents that a `null` map, not a missing entry, is the rollback signal, so the invariant is stated at the field rather than implied far away.
   
   Local verification (JDK 11, `seatunnel-engine-server`):
   - On the previous head `4de899d4e` I reproduced your exact signatures: `testCriticalCallTime:392 expected: <100> but was: <1>` and `testDelay:516/517 NoSuchElementException`.
   - On `36d911bd6`: `TaskExecutionServiceTest` passes, **Tests run: 22, Failures: 0, Errors: 0**. This includes `testCriticalCallTime`, `testDelay`, both rollback regressions, and the two atomic-claim tests.
   - `./mvnw spotless:apply` and `./mvnw -DskipTests verify` on the module are clean.
   
   **Issue 2 (High): checked against a clean `dev` baseline**
   
   - `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck`: #12353 shows this reproduces on unmodified `dev` (dev @ `6ee0c3744` on JDK 17, and dev @ `75b60fa14` plus a comment-only change on JDK 8). SEZ9 also lists completed `dev` `Build` runs (`34801745423`, `34821874806`, `34935118103`, `34995029902`, `35063682504`, `35219017572`), each with at least one red `engine-v2-it` leg, and confirmed this test as the cause on the 09-17 run. Your own classification there points at `SubPlan.addPhysicalVertexCallBack` / `getPipelineEndState()` giving `failedTaskNum > 0` priority over a requested cancel. The fix in your #12311 touches `CoordinatorService` only; neither touches `TaskExecutionService` / `TaskGroupContext`.
   - `BackpressureSlowSinkIT.testCheckpointsKeepCompletingUnderSustainedBackpressure`: your #12313 reports it failing on `dev` itself (`34821874806`: observed 0, `34801745423`: observed 2). The root cause is in the test fixture: the 10M-row single split keeps `FakeSourceReader` re-entering the checkpoint lock, which starves `triggerBarrier`. That fix only changes the IT and its `.conf`. On whether the task-skipping bug could have caused it: as you noted, production `deployTask` always puts a classloader for every task, so that branch was not reachable in the E2E path. And as of `36d911bd6` the branch can't skip a non-rolled-back task at all.
   
   So both E2E failures predate this PR and are tracked by #12353 → #12311 and #12313. Once those land in `dev`, I'm happy to rebase so `engine-v2-it` is re-checked on a clean base. The PR is currently `MERGEABLE` against `dev`, and fork CI will re-run on the new head.
   
   @SEZ9 FYI, since you followed up on the CI item last round: the unit-test regression is fixed, and the remaining `engine-v2-it` failures map to the issues above.
   
   Please take another look when you have time. Thanks again for the careful reviews!
   


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @SEZ9. I agree with the evidence for the two failed fork jobs: the fault-tolerance race and the Testcontainers registry HTTP 500 both occur outside the changed  path, so they do not ask for a speculative source patch in this PR. The head is unchanged, so this is a thread follow-up rather than another complete review. No source action is needed from the author on those failures; the remaining repository gate is a write-capable maintainer's approval once CI is acceptable.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks, @SEZ9. The dropped-task accounting point should remain open until the three paths are mapped to actual assertions; an author description alone does not close it. Please supply the short path-to-test list and explain any case where taskDone is omitted without reducing the expected generation count. My earlier High findings about atomic worker-versus-rollback ownership and holding the cooperative close-failure probe until rollback owns it also remain open; the green Build does not resolve those test/ownership gaps. Please keep the remaining Javadoc, setter-invariant and cleanup/assertion-status answers separate from those blockers, and identify which are fixed versus deferred. I am not claiming that a new implementation exists on this unchanged head.
   
   Discussion-only follow-up on unchanged head `0b242a32716c56b0214b8d14e21c4b1a91064418`. Compare `diverged`, ahead 17 / behind 69; drift alone is not a sync request. No new full source review or local build/test/runtime execution is claimed. Daniel has READ permission; effective maintainer approval/dismissal remains independent.
   
   Current snapshot (2026-11-27T03:04:09.408568+00:00): Signal pull request update: SUCCESS; Build: SUCCESS; merge state `BLOCKED`; review decision `REVIEW_REQUIRED`.
   


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @Rangsh thanks for the detailed mapping and the CI update.
   
   Your description of `e3a9b8eb` lines up with each of the previously raised points: dropped-task accounting, the `deployLocalTask` Javadoc, test cleanup and assertion placement, the `TaskGroupContext` setters and `volatile` `jars`, the PR description, and the test helper cleanup. I have not yet checked those changes against the diff itself, so I am treating the points as pending verification rather than resolved.
   
   One question on the dropped-task accounting point: which of the new tests assert that the rolled-back tracker actually completes for each of the three dropped cases (removed from the cooperative queue, never submitted, cancelled before start)? If any case is only covered indirectly, please say so.
   
   On CI, noted the green fork Build you reported (run 44970214239, attempt 3) and the 27/27 local `TaskExecutionServiceTest` result. Going by your description of the earlier HTTP 429 on the Maven Wrapper download, no change is needed from you there.
   
   Formal approve/merge still needs a committer's review.
   
   <!-- streview-comment:2533 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 Thanks for the follow-up — happy to spell out test coverage vs the three dropped paths in `accountForTasksDroppedAfterRollback` on `e3a9b8eb`.
   
   **Not in scope for these three branches:** `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy` covers the `onContextPublished` side of #12164 (failure before cooperative/blocking submit). That path does not enqueue cooperative work or create blocking futures, so it does **not** exercise the three dropped `taskDone` cases.
   
   **Integration test that touches dropped paths (mostly indirectly):** `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection` (PART mode: one cooperative task enqueued, first blocking worker enters `call()`, second blocking `submit` rejected, third task never submitted).
   
   | Dropped case | Direct assertion that the rolled-back **tracker/generation completes**? | What the test actually asserts |
   |---|---|---|
   | **(1) Cooperative removed from `threadShareTaskQueue`** | **Indirect only.** | `threadShareQueueContainsLocation` is false; no active context; no cancellation future leak; `finishedExecutionContexts` contains the location; classloader ref count 0; later `deployTask` runs `ExecutionMarkerTask`. Rollback hygiene + successful redeploy — not an explicit check that completion bookkeeping / the result future reached a terminal state for the failed generation. |
   | **(2) Blocking never submitted** (`i >= blockingFutures.size()`) | **Indirect only.** | Same test: second submit throws after the first blocking probe starts; task `3L` never gets a future. Same indirect rollback/redeploy/classloader assertions; no assertion tied specifically to the “never submitted” index branch. |
   | **(3) Blocking future cancelled before `BlockingWorker` runs** (`isCancelled() && isDone()` without a started worker) | **No dedicated scenario today.** | Here the first blocking probe **does** enter `call()` (interruption asserted). The rejected task is case (2), not (3). Case (3) is defensive for futures that exist but have not started when rollback cancels them. |
   
   **Summary:** No single test directly asserts terminal completion for **each** of the three cases; **(1)** and **(2)** are covered **indirectly together** in `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection`, and **(3)** has **no dedicated scenario** yet (logic is in production code).
   
   If you think case (3) needs to be pinned explicitly, or you want a direct terminal-completion assertion for the failed generation in the partial-submit test, I can add that in a follow-up commit.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks for the exact links. I checked the unchanged `b41db8fc56213` source. Registration precedes publication, rollback accounts for the dropped tasks, and the three failure cases assert generation accounting. The TaskGroupContext fields suppress the generated setters, and the stop marker and executor override cleanup are present. The helper's line number has shifted, but the code you describe is there. This confirms my technical conclusion on the current head. The final independent maintainer review is still open.
   
   [Current Build](https://github.com/apache/seatunnel/runs/143455511780)


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @DanielLeens for the independent CI verification and for confirming Issues 1/2 are resolved. Happy to leave the deterministic CooperativeTaskWorker race test out of this PR unless a maintainer wants it here.
   
   Could a committer with write access please take a look for formal approve/merge? Thanks!


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 Thanks — the both-sides coverage point is addressed in fee6db3b3.
   
   The PR now has a paired regression for each side of the post-publication boundary:
   
   1. `testDeployLocalTaskRollsBackAfterPostPublishFailureAndAllowsRedeploy`
      - deterministic failure from `onContextPublished`
      - asserts `executionContexts` / `cancellationFutures` are cleared
      - asserts a later `deployTask` for the same `TaskGroupLocation` actually executes
   
   2. `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection`
      - deterministic `RejectedExecutionException` at task submission (after partial blocking submit)
      - asserts the same map cleanup
      - follow-up redeploy now also goes through `deployTask(Data)` (not `deployLocalTask`), so it exercises the master-failover skip branch rather than bypassing it
   
   Local check (JDK 11): both tests pass.
   
   Happy to take any further comments here on the PR. Thanks!


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @DanielLeens @SEZ9 Rebased onto latest `dev` as requested (head `6ed996701e`).
   
   While rebasing, adapted the rollback onto the post-#12238 executionId / context-keyed deployment model rather than reintroducing location-keyed `cancellationFutures`:
   - Keep two-phase publish (`cancellationFutures` / async / timer maps by `TaskGroupContext`, then `executionContexts` last)
   - On post-publish failure: abort tracker, drain cooperative queue, generation-safe `executionContexts` remove, clear context-keyed maps, release owned classloaders
   - `BlockingWorker` / `CooperativeTaskWorker` early guards retained
   - Both-sides regression tests updated for `executionId` + context-keyed cancellation assertions; redeploy still goes through `deployTask(Data)`
   
   Local: `TaskExecutionServiceTest` — `Tests run: 20, Failures: 0, Errors: 0, Skipped: 0`
   
   PR is now `MERGEABLE` against `dev`. Remaining MinIO pull failures (if they still appear) remain the pre-existing Docker Hub infra issue tracked by #12287 and are unrelated to this diff.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @DanielLeens — appreciated the from-scratch re-review on the post-#12238 adaptation.
   
   **Issue 1 / Issue 3 (Low):** addressed in `33d20cfe3`:
   1. Dropped the redundant second `cancelAsyncFunctionFutures` / `cancelTimerFlushFutures` from `rollbackPublishedDeployment` (`abortAfterFailedPublish` → `cancelAllTask` already covers them).
   2. Mirrored `finishExecution` so a rolled-back attempt is recorded into `finishedExecutionContexts` (generation-safe `compute`), and asserted that in the post-publish rollback unit test.
   
   **Issue 2 (High / CI):** investigated against run [`34755083145`](https://github.com/Rangsh/seatunnel/actions/runs/34755083145):
   
   - `testStaleTaskDoneCleansOnlyOwnedGenerationResources`: confirmed the Mockito `WantedButNotInvoked` on `cancel(false)` after a single `isDone()` interaction. This test is from #12238 and does not call this PR's rollback path. Locally, `TaskExecutionServiceTest` is **20/20 green** (including that method, repeatedly). Hardened the pending-`ScheduledFuture` stub to `doReturn(false).when(future).isDone()` to avoid stubbing-side invocation quirks. A fresh push (`33d20cfe3`) is up so fork CI can re-check determinism on `unit-test` / `engine-v2-it`.
   - `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck`: log shows `expected: <CANCELED> but was: <FAILED>` within 1 minute after the intentional worker crash. Will watch the new `engine-v2-it` run; if it reproduces we will dig further (possibly with #12238 owners) rather than wave it away.
   
   Will follow up with the isolated re-run results once they finish.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   Thanks @Rangsh. Nothing new to add from my side since my last note: your reading of both failed jobs on fork run 38496659794 (head `35f5a2fcf7c`) matches mine, and the head has not moved since `154d6e9891a` apart from the clean `dev` merge, so my conclusion is unchanged.
   
   - `engine-v2-it (11)` (job 115650597710) is the known unrelated cancel-vs-worker-loss race in `SplitClusterFaultToleranceIT.testStreamJobCancelResolvesWhenWorkerCrashesBeforeCancelAck`; it does not go through a failed `deployLocalTask`, and a sync will not clear it.
   - `kafka-connector-it (17)` (job 115650597797) fails only in the Testcontainers image build (`received unexpected HTTP status: 500 Internal Server Error`) before any Kafka test logic runs, so I agree it is a runner/registry flake unrelated to this PR.
   
   No source change needed from you. Syncing with `dev` whenever convenient would give you a fresh fork run for the Kafka lane, but that is optional and not a gate from my side. The remaining step is the committer approval, which I cannot give as a read-only reviewer. Thanks again for the patient iterations.
   
   <!-- streview-comment:1763 -->


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9
   
   Thanks for the follow-up. As you noted, the two **High** items in [Daniel’s review 6038243309](https://github.com/apache/seatunnel/pull/12218#pullrequestreview-6038243309) stay with @DanielLeens; see also [#7150067996](https://github.com/apache/seatunnel/pull/12218#issuecomment-7150067996) for how `0b242a3271` maps to those items.
   
   **Branch:** `fix/zeta-deploy-local-task-rollback-12164` · **HEAD:** `0b242a3271`
   
   ---
   
   ## Dropped-task accounting (Medium)
   
   Post-publish rollback calls `registerExpectedBlockingTasks` (before the blocking submit loop) and `accountForTasksDroppedAfterRollback` on rollback, including cooperative trackers removed from `threadShareTaskQueue` (`close()` + `taskDone` where applicable). Tests use **`assertFailedGenerationAccounting`**: `completionLatchRemainingForTests() == 0` and `tasksReportedDoneCountForTests()` equals the expected generation size (`lastLocalDeployExecutionTrackerForTests`).
   
   **Drop path → accounting → test**
   
   | Drop path | Accounting on rollback? | Test | Proof in test |
   |-----------|-------------------------|------|----------------|
   | **Never submitted** (blocking tail not accepted / never enters `call()`) | Yes | `TaskExecutionServiceTest.testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection` | `assertFailedGenerationAccounting(..., 4)`; `PartialSubmitProbeTask.enteredCall(4L)` is false |
   | **Cancelled before start** (blocking cancelled or tail rejected; first blocking entered `call()` before tail reject) | Yes | `TaskExecutionServiceTest.testRollbackAccountsBlockingCancelledBeforeWorkerStarts` | `assertFailedGenerationAccounting(..., 3)`; `enteredCall(11L)` / `enteredCall(12L)` false |
   | **Removed from cooperative queue** (thread-share tracker drained; `close()` on initialized cooperative work) | Yes | **Primary:** `TaskExecutionServiceTest.testRollbackSurvivesCooperativeCloseFailureAndAllowsRedeploy` — `assertFailedGenerationAccounting(..., 1)`; rollback survives cooperative `close()` throwing **`Throwable`**; redeploy runs. **Secondary (mixed queue + blocking):** `testDeployLocalTaskRollsBackAfterPartialBlockingSubmitRejection` — cooperative queue has no residual trackers for the failed location; **`assertFailedGenerationAccounting(..., 4)`** includes the thread-share probe plus blocking probes. |
   
   **Which test covers “removal from the cooperative queue”?** → **`testRollbackSurvivesCooperativeCloseFailureAndAllowsRedeploy`** (primary). Partial-submit is the mixed path that also asserts the queue is drained.
   
   ---
   
   ## Checklist — fixed on HEAD vs only in `0b242a3271`
   
   You asked for **fixed in `0b242a3271` or pending** per item. Hygiene and docs mostly landed in **`6d6a380a9b`** / **`66af82ec9d`** / **`e778df2e24`**; **`0b242a3271` only extended accounting checks, submit gates in tests, cooperative `close(Throwable)` on rollback, and the cooperative close-failure regression.**
   
   | Item | Status |
   |------|--------|
   | **`deployLocalTask` Javadoc** — post-publish `rollbackPublishedDeployment` + **FAILED** vs pre-publication **`completeExceptionally`** (Medium) | **Fixed on `6d6a380a9b`** (on HEAD). Not re-edited in `0b242a3271`. |
   | **Callback-side rollback test** — cleanup outside `finally`; `stop.set(true)` no effect on deserialized task | **Fixed on `6d6a380a9b`**. `ExecutionMarkerTask`: static `STOP`, `reset()` before redeploy, `requestStop()` in **`finally`** + `cancelTaskGroup`. |
   | **PR description** — `TaskGroupContext` public method + `volatile` fields | **Fixed on PR body** — Scope lists `TaskGroupContext.java`: `claimJarsForClassLoaderRelease()`, once-only release, **`classLoaders` / `jars` `volatile` with `@Setter(AccessLevel.NONE)`**. |
   | **`TaskGroupContext` setters / `volatile`** | **Fixed on `6d6a380a9b`**. `@Setter(AccessLevel.NONE)` on both maps; both **`volatile`**. |
   | **Assertions inside overridden `submit()`** swallowed by production `catch (Throwable)` | **Fixed on `66af82ec9d` / `6d6a380a9b`**. Custom `submit()` only sets gate flags and throws; assertions after deploy returns. |
   | **Partial-submit test** — rejecting executor and PART mode before `try`/`finally` | **Fixed on `6d6a380a9b`**. Setup inside **`try`**; restore in **`finally`**. |
   | **Test helper cleanup** — unused `callCount()`, inline FQ type, executor override “two ways” | **(1)** Removed unused `ExecutionMarkerTask.callCount()`; blocking override unified on **`setBlockingTaskExecutorOverride`** applied to **both** spy and real service (commented — spy does not share the field): **Fixed on `6d6a380a9b`**. **(2)** Inline `java.util.concurrent.CompletableFuture` local in **`assertFailedGenerationAccounting`** (`e778df2e24` / `0b242a3271`): **Pending (Low, non-blocking)** — can switch to the engine `CompletableFuture` import in a tiny follow-up or cleanup PR. |
   
   Low items marked **Pending** are non-blocking for Medium dropped-task accounting sign-off.
   
   ---
   
   ## CI
   
   Fork **Build** on **`0b242a3271`**: https://github.com/Rangsh/seatunnel/actions/runs/45525756694 — **success** (after re-run). First attempt failed on infra unrelated to #12164 (`MavenWrapperMain` on unit-test; `DatabendCDCSinkIT` / Testcontainers on `all-connectors-it-6`). Local: **`TaskExecutionServiceTest` 29/29** on HEAD.
   
   If the drop-path table above truncates in your client, I can paste a one-screen version in a follow-up.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @DanielLeens Issue 4 is addressed on `66af82ec9d`:
   
   1. The rejecting executor now awaits `firstBlockingEnteredCall` before throwing on the second `submit`, so the first blocking probe (task id `2L`) must enter `PartialSubmitProbeTask.call()` while rollback still targets a started worker.
   2. After the interruption assertion, the test awaits `firstBlockingInterruptedExit` so the started probe finishes before resetting the executor / thread-share mode.
   
   Local: `TaskExecutionServiceTest` — 27/27 pass. Fork Build will re-run on this push. Thanks again for catching the scheduling hole.


-- 
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] Roll back TaskExecutionService context on post-publish deploy failure [seatunnel]

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

   @SEZ9 Thanks for the detailed review on `66af82ec`. Addressed items on the new head:
   
   **Issue 1 (P1):** `rollbackPublishedDeployment` now calls `TaskGroupExecutionTracker.accountForTasksDroppedAfterRollback`: `taskDone` for cooperative trackers removed from `threadShareTaskQueue`, blocking tasks never submitted, and blocking futures cancelled before `BlockingWorker` ran; `reconcileCompletionAfterRollback` drains any remaining latch. `taskDone` is idempotent per task id.
   
   **Issues 2–8 (P2):** `deployLocalTask` Javadoc documents post-publish FAILED vs pre-publish exceptional completion; PR scope note in this comment adds `TaskGroupContext.java` + seven new tests; `TaskGroupContext` blocks public setters on `classLoaders`/`jars` and makes `jars` volatile; partial-submit / init-during-submit tests record latch results on the test thread; partial-submit uses early `try/finally` for shared server overrides; `ExecutionMarkerTask` uses static stop + `finally` cleanup; removed unused `callCount()`, imported `BlockingDeque`, unified executor override helper.
   
   Local: `TaskExecutionServiceTest` — 27/27 pass. Fork Build will re-run on this push. @DanielLeens FYI.


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