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

[PR] [Fix][Zeta] Preserve cooperative task classloaders across restore [seatunnel]

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

   ## Summary
   
   - keep each cooperative task tracker bound to the class-loader context created for its own execution generation
   - avoid resolving a resumed task's loader from the location-keyed active-context map after restore reuses the same task group location
   - add regression coverage for two generations sharing a task location and task ID
   
   Closes #12224
   
   ## Verification
   
   - `./mvnw -q -pl seatunnel-engine/seatunnel-engine-server spotless:apply`
   - `./mvnw -o -q -pl seatunnel-engine/seatunnel-engine-server -DskipITs -Dtest=TaskExecutionServiceTest -Dsurefire.failIfNoSpecifiedTests=false test`
   
   The targeted suite passed: 16 tests, 0 failures, 0 errors.
   
   A full reactor verification was attempted but the existing `seatunnel-config-shade` module fails before this change is compiled because required relocated Typesafe Config sources are missing.


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   Thanks @zhangshenghang for the detailed writeup on 6202ad987. The approach you describe for each of the three points sounds like the right direction:
   
   - **F1**: having `recycleClassLoader()` act only on the tracker's `ownedContext`, using `executionContexts.remove(taskGroupLocation, ownedContext)` in `taskDone`, and recording the actually-finished generation in the finished map matches what I was after. Throwing `IllegalStateException` when the owned context's loader map has been recycled, while still falling back to the system TCCL when there is simply no per-task entry, is a sensible split — thanks for calling that distinction out.
   - **F2**: routing `BlockingWorker.run` through `getTaskClassLoader` and moving the lookup inside the try after `startedLatch.countDown()` should address both the generation issue and the latch concern.
   - **F3**: `testStaleGenerationCleanupDoesNotRecycleNewerContext` as described covers the cleanup path, and a fuller `deployLocalTask` + `CooperativeTaskWorker` run as a follow-up is fine with me.
   
   I still need to verify these against the actual diff before marking the findings resolved. In the meantime, two small asks:
   
   1. For the fail-fast path: can you confirm (or add a short assertion) that when `getTaskClassLoader` throws inside `CooperativeTaskWorker.run` / `BlockingWorker.run`, the exception reaches the tracker's normal failure handling (i.e. the task group is marked failed rather than the worker exiting silently)? That was the "silent null" half of F1.
   2. In the new test, please also assert on the stale tracker itself — that after its `taskDone`, calling its `getTaskClassLoader` throws `IllegalStateException`, and that the newer tracker's `getTaskClassLoader` still returns the expected loader. That pins both sides of the generation split in one place.
   
   If you'd rather fold the second one into the follow-up, just say so. I'll do a pass over the code once I've had a chance to read the diff.
   
   <!-- streview-comment:1002 -->


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   Thanks @SEZ9 for the thorough review, and @DanielLeens for verifying the findings — all three issues are addressed in 6202ad987:
   
   - **Issue 1 (cleanup generation-awareness)**: `recycleClassLoader()` now operates on the tracker's `ownedContext` (nulls its own loader map and releases its own jars) instead of resolving through the location-keyed map. `taskDone` uses `executionContexts.remove(taskGroupLocation, ownedContext)` so a stale generation can no longer remove or recycle a newer generation's context, and the finished map now records the generation that actually finished.
   - **Fail-fast on recycled context**: `getTaskClassLoader` now throws `IllegalStateException` when the owned context's loader map has been recycled (null), instead of silently handing a null TCCL to the worker. Note the null check is on the loader **map**, not the per-task entry: a task without a registered per-task loader (task groups deployed without connector jars) still falls back to the system TCCL exactly as before, so no behavior change for that legitimate case.
   - **Issue 2 (BlockingWorker)**: `BlockingWorker.run` now resolves via `getTaskClassLoader` as well, and the resolution moved inside the try-block right after `startedLatch.countDown()`, so a lookup failure can no longer leave the deployer blocked on the latch.
   - **Issue 3 (regression test)**: added `testStaleGenerationCleanupDoesNotRecycleNewerContext` — publishes two generations at the same `TaskGroupLocation`, runs the stale generation's `taskDone`, and asserts the newer generation's context stays published with its classloaders intact (this fails against the previous location-keyed cleanup). A fuller end-to-end regression through `deployLocalTask` + `CooperativeTaskWorker` is a fair follow-up; I kept this one to the unit level to stay reviewable.
   
   Local verification: `TaskExecutionServiceTest` 17/17 green including the new test and `testThrowException`.


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   Confirmed both of your asks against the current head (`6202ad987`), for the record:
   
   1. Yes -- the `IllegalStateException` from `getTaskClassLoader()` is fully routed through normal failure handling on both paths, not a silent worker exit. In `CooperativeTaskWorker.run()` the call sits inside the `try` block (around lines 1268-1274), and its `catch (Throwable e)` (line 1289) calls `taskGroupExecutionTracker.exception(e)` then `taskDone(...)`, same as any other task-body exception. In `BlockingWorker.run()` it's inside the `try` right after `startedLatch.countDown()` (lines 1136-1140), and its own `catch (Throwable e)` (line 1154) does the same `exception(e)` plus `finally { taskDone(t) }`. `exception()` does a `compareAndSet` on `executionException`, and `taskDone()` reads it back once the completion latch hits zero to drive the task group to a failed terminal state -- so a recycled context now fails the task group loudly on either path, which is exactly the fail-fast behavior the fix is going for.
   
   2. Your second ask -- asserting directly that the stale tracker's own `getTaskClassLoader` throws after its `taskDone`, alongside the newer tracker still resolving correctly -- is a good tightening of the existing test. It pins both halves of the generation split in one assertion rather than only checking the newer tracker's success and implying the stale one is inert. I'd be fine with it landing in this PR or folded into the same follow-up as the end-to-end `CooperativeTaskWorker`/`BlockingWorker` coverage we already agreed on; either way it isn't blocking, since the current test already fails against the pre-fix code for the scenario it does cover.
   
   One thing worth surfacing that's independent of the code discussion: the PR is currently showing `mergeStateStatus: DIRTY` / `mergeable: CONFLICTING` against `dev`. That will need a rebase/merge from zhangshenghang before this can actually be merged, regardless of where we land on the open questions above.
   
   CI-wise, nothing has changed since my last pass: same fork run for this exact head, same two `engine-v2-it` failures (`SplitClusterFaultToleranceIT`, `BackpressureSlowSinkIT`) I already traced back to the pre-fix commit as pre-existing, unrelated flakes -- no new failures to factor in.
   
   My own conclusion stands at Ready to merge on the code itself; happy to defer to your own pass over the diff before we call this fully closed.


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   Thanks @SEZ9 — glad our independent reads of the `0f0e78a4c8` merge converged. No new commit since then, so this is a confirmation, not a fresh review.
   
   To be precise about what I actually re-checked on that merge (since it wasn't a trivial fast-forward — `dev` picked up #12238's `TaskGroupContext.executionId`-keyed cleanup in the same two files this PR owns): the fail-fast `getTaskClassLoader()`, the `BlockingWorker` latch-before-lookup ordering fix, and both regression tests survived the merge, with the identity-checked cleanup now expressed through `dev`'s `finishExecution()`/`executionContexts.compute()` primitive instead of the original `remove(location, ownedContext)`. Same conclusion you reached independently.
   
   Live status: CI (`Build`) was still `IN_PROGRESS` on my last check — I'll leave that for a maintainer or the next pass to confirm green rather than watching it here. `mergeable_state` is `blocked`, consistent with this just needing a formal committer approval/merge rather than any open code item.
   
   My "ready to merge" conclusion stands. The one non-blocking note from my last pass still applies: an end-to-end `CooperativeTaskWorker`/`BlockingWorker` regression test through the real task queue would be a good follow-up, since neither existing unit test drives the `BlockingWorker` ordering fix through an actual worker iteration — but that's not a blocker.
   


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   Thanks @SEZ9 — glad our independent reads of the `0f0e78a4c8` merge converged. No new commit since then, so this is a confirmation, not a fresh review.
   
   To be precise about what I actually re-checked on that merge (since it wasn't a trivial fast-forward — `dev` picked up #12238's `TaskGroupContext.executionId`-keyed cleanup in the same two files this PR owns): the fail-fast `getTaskClassLoader()`, the `BlockingWorker` latch-before-lookup ordering fix, and both regression tests survived the merge, with the identity-checked cleanup now expressed through `dev`'s `finishExecution()`/`executionContexts.compute()` primitive instead of the original `remove(location, ownedContext)`. Same conclusion you reached independently.
   
   Live status: CI (`Build`) was still `IN_PROGRESS` on my last check — I'll leave that for a maintainer or the next pass to confirm green rather than watching it here. `mergeable_state` is `blocked`, consistent with this just needing a formal committer approval/merge rather than any open code item.
   
   My "ready to merge" conclusion stands. The one non-blocking note from my last pass still applies: an end-to-end `CooperativeTaskWorker`/`BlockingWorker` regression test through the real task queue would be a good follow-up, since neither existing unit test drives the `BlockingWorker` ordering fix through an actual worker iteration — but that's not a blocker.
   


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   Thanks for the follow-up commit. Re-checked at 3d57b64ddde against the three earlier points:
   
   **F1 (stale generation vs. new generation's loaders)** — The lookup half looks addressed: `deployLocalTask()` hands the exact `TaskGroupContext` instance to the `TaskGroupExecutionTracker`, and the cooperative hot loop now resolves through `tracker.getTaskClassLoader(taskId)`, which throws when the context's loaders are null instead of silently returning `null`. What I still can't confirm is the terminal cleanup path (`recycleClassLoader`/`taskDone`): is it still location-keyed, or does it now act on the tracker-owned context as well? A pointer to that part of the change would help.
   
   **F2 (`BlockingWorker` location-keyed lookup)** — Looks resolved. `BlockingWorker.run()` now resolves via `getTaskClassLoader(taskId)` on the tracker-owned context inside the existing try/catch, with `startedLatch.countDown()` remaining the first unconditional statement, so `ThreadShareMode.OFF` and non-sharing `PART` tasks get the same generation-safe behaviour as cooperative tasks.
   
   **F3 (regression test strength)** — Could you point me to the updated test? I'd like to confirm it exercises the fixed path: two generations at one `TaskGroupLocation`, generation A's worker receiving A's loader, and A's cleanup leaving B's loaders intact.
   
   <!-- streview-comment:1435 -->


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   Thanks @SEZ9 - I went back and verified both points directly against `9f98c147ce23` (same head you reviewed) rather than taking them on faith, and they hold up. This is a solid extension of the two things I flagged in my own pass, with sharper evidence on both:
   
   **Your Issue 1 (recycleClassLoader/taskDone still location-keyed) = my Issue 2, confirmed and sharpened.** I checked `TaskExecutionService.java:1453-1520` myself:
   - `taskDone()` (1453-1508) calls `recycleClassLoader(taskGroupLocation)` (1461) and then `executionContexts.remove(taskGroupLocation)` (1463) - both keyed purely by the reused `TaskGroupLocation`, never by `ownedContext` identity.
   - `recycleClassLoader` (1510-1516) does `executionContexts.get(taskGroupLocation).setClassLoaders(null)` - if generation B has already published its context at that location (line ~675 in `deployLocalTask`), a straggling generation A's cleanup nulls B's live loader map and releases B's jars out from under it.
   - The part I hadn't traced as precisely as you did: `getTaskClassLoader()` (1518-1520) just returns `ownedContext.getClassLoader(taskId)`, and once that map is nulled this returns `null` silently instead of the old `NullPointerException` from the pre-PR `executionContexts.get(location).getClassLoaders().get(...)` chain. That's a real regression in failure signal quality on top of the correctness bug - it used to fail loud, now it fails quiet. Agreed this should be a blocker, not a follow-up.
   
   **Your Issue 2 (BlockingWorker still location-keyed) = my Issue 1, and you found something worse than what I flagged.** I only pointed out that the PR/issue description incorrectly claims #11727 already covers `BlockingWorker`, which is unmerged (`gh pr view 11727` still shows `state: OPEN`, `mergedAt: null`) - a documentation/scope-accuracy problem. You went further and showed it's an active deadlock risk, which I confirmed: `BlockingWorker.run()` (`TaskExecutionService.java:1132-1136`) resolves the loader *before* the `try` block that starts at 1141, so if that lookup NPEs (context removed/nulled by a stale generation's `taskDone`), `startedLatch.countDown()` (1142) never runs. I checked `submitBlockingTask` (`TaskExecutionService.java:384-411`): it does `uncheckRun(startedLatch::await)` at line 410 and does not return until every worker's latch counts down - so that NPE doesn't just fail one task, it hangs the deploying thread indefinitely with the task group never reaching a t
 erminal state. That's strictly worse than "same bug, different path" - it's a hang, not just a misload. Given `Task.isThreadsShare()` defaults to `false` (execution/Task.java:44-46) and nothing overrides it, this is the common path under both `OFF` and `PART`, not an edge case.
   
   Net: I'm changing my "blocking on Issue 1 (description fix) + non-blocking on Issue 2 (write-path race)" stance to align with yours - both need code fixes before merge, not just a description correction. Your suggested fixes (identity-checked `executionContexts.remove(location, ownedContext)` in `taskDone`, `ownedContext`-based `recycleClassLoader`, routing `BlockingWorker` through `taskGroupExecutionTracker.getTaskClassLoader(...)` with the lookup moved inside the `try`) match what #11727 already prototypes for the write side, so pulling that pattern into this PR (or landing #11727 first and rebasing this on top) both seem like reasonable paths - your call which is less disruptive given where #11727 currently stands.
   
   @zhangshenghang - given both independent reviews converge on the same two gaps (stale-generation cleanup corrupting the live context, and BlockingWorker keeping the original race under the default execution mode with an added hang risk), I'd treat these as must-fix before merge rather than follow-ups.
   


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   Thanks for the update. The thread notes that `40c6fab85` is a pure sync with `dev` and that the PR's own diff is unchanged from `3d57b64dd`, so my three earlier points still apply to this head. I can't verify the current code from the discussion alone, so a few confirmations would help me close them out:
   
   **F1 (terminal cleanup keyed by location)** – The description of `taskDone` going through `finishExecution` with a `context.equals(activeContext)` guard inside `executionContexts.compute`, followed by `recycleClassLoader(taskGroupLocation, context)` on the tracker's own context, is exactly the shape I was after. Could you point me at that hunk in the diff? Also, if a tracker's own context has already been recycled (loaders set to `null`), what does `getTaskClassLoader` return to the worker? If it can still return `null`, I'd prefer failing fast, or at least a WARN log, rather than silently installing a `null` TCCL.
   
   **F2 (`BlockingWorker` reading the location-keyed map)** – Please confirm that `BlockingWorker.run()` now resolves the loader via the tracker's `getTaskClassLoader` and no longer reads `executionContexts` directly, so non-cooperative tasks (`ThreadShareMode.OFF`, or `PART` with `isThreadsShare()==false`) get the same fix. The thread mentions `startedLatch.countDown()` still happens before the class-loader lookup, which is the ordering we want.
   
   **F3 (test coverage)** – `testStaleGenerationCleanupDoesNotRecycleNewerContext`, as described (publishing a newer context at the shared `TaskGroupLocation`, running `firstTracker.taskDone(...)`, and asserting the first context's loaders are nulled while the newer one stays published and resolvable), would address the core of my concern. Once I can see those assertions in the test diff I'm happy to close this. Non-blocking nit: a variant that drives `CooperativeTaskWorker` or `BlockingWorker` through `run()` would also lock in the call-site behavior; fine as a follow-up.
   
   CI on this head is reported green in the thread (fork run `37393279489`, attempt 2, succeeded). With the confirmations above I expect no further blockers from my side.
   
   <!-- streview-comment:1689 -->


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   Follow-up on the merge commit `0f0e78a4c8`, the only new commit since `6202ad987` ("Ready to merge"). It carries no independent logic, but since the merge conflicted in the two files this PR touches, I re-read the merged result against my three earlier points rather than treating it as a no-op:
   
   - The `getTaskClassLoader()` fail-fast is present, now reading off `context`, and both `BlockingWorker.run()` and `CooperativeTaskWorker.run()` still route through it.
   - The `BlockingWorker` ordering fix (`startedLatch.countDown()` first, before the class loader lookup) is present and unchanged.
   - The identity-checked cleanup in `recycleClassLoader()`/`taskDone()` is now expressed through `dev`'s `finishExecution()`/`executionContexts.compute()` path keyed by `TaskGroupContext.executionId`; the intent (a stale generation can't clobber a newer one) survives.
   - Both regression tests, `testCooperativeTrackerKeepsGenerationSpecificClassLoader` and `testStaleGenerationCleanupDoesNotRecycleNewerContext`, are present and updated for the new `TaskGroupContext` constructor.
   
   Nothing was lost in the merge and I have no new concerns. Still good to merge from my side — thanks for keeping the branch current.
   
   <!-- streview-comment:1036 -->


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   @SEZ9 — good timing question, I posted a full re-review of `80f6c5e44ac` about 12 minutes before your comment, so here are the direct pointers rather than making you dig for them:
   
   **F1 (location-keyed terminal cleanup)** — confirmed present in the merge, now expressed through `dev`'s `#12238` primitives rather than the original `remove(location, ownedContext)` shape:
   - `getTaskClassLoader()` fail-fast: `TaskExecutionService.java:1643-1655` — throws `IllegalStateException` naming the `TaskGroupLocation` when `context.getClassLoaders() == null` (recycled), returns `classLoaders.get(taskId)` otherwise (legitimate `null` only for a task with no per-task loader, no behavior change there).
   - Identity-checked cleanup: `TaskGroupExecutionTracker.taskDone()` → `finishExecution(location)` at `:1599, 1664-1704` — `executionContexts.compute(location, (ignored, active) -> context.equals(active) ? {...; return null} : active)` at `:1671-1679`. Identity is via `TaskGroupContext.equals()`/`hashCode()`, which is `executionId`-only (see `execution/TaskGroupContext.java:98-113`) — so this is a no-op against the map once a newer generation has overwritten the entry for that location. `recycleClassLoader` operates on `context` (the tracker's own object) at `:1694-1698`, never on `executionContexts.get(location)`.
   
   **F2 (`BlockingWorker` location-keyed read)** — confirmed, yes it now resolves off the tracker-owned context, not the shared map: `BlockingWorker.run()`, `TaskExecutionService.java:1277-1300` — `startedLatch.countDown()` runs first and unconditionally at `:1284`, then `taskGroupExecutionTracker.getTaskClassLoader(t.getTaskID())` at `:1287-1288`, both inside the same `try`. So the generation-safety fix and the latch-ordering fix are both intact, and I also re-verified in my review that a thrown `IllegalStateException` here still reaches `taskGroupExecutionTracker.exception(e)` → `taskDone(...)` via the existing `catch (Throwable e)`, not a silent worker exit.
   
   **F3 (end-to-end regression coverage)** — still open, still non-blocking, listed as Issue 1 in my last review's summary table. Your suggested shape (publish two `TaskGroupContext` generations at the same location, drive an older-generation task through the real worker, assert it resolves the older loader while the newer context stays intact) is exactly the gap — the two existing unit tests call `getTaskClassLoader()`/`taskDone()` directly on hand-built trackers rather than through an actual `CooperativeTaskWorker.run()`/`BlockingWorker.run()` iteration, so a regression at `:1284`/`:1287`/`:1421` itself wouldn't be caught today. Fine as a follow-up rather than blocking this PR.
   
   With F1/F2 confirmed against the actual diff and F3 tracked as a non-blocking follow-up, my conclusion is unchanged: Ready to merge, no open blockers from my side.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix][Zeta] Preserve cooperative task classloaders across restore [seatunnel]

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

   Quick follow-up on my three earlier points, looking at the `0f0e78a4c8` merge. I don't have the merged diff in front of me here, so I'd rather confirm than assert:
   
   **F1 – location-keyed terminal cleanup.** The intent is that cleanup now goes through the identity-checked `finishExecution()` / `executionContexts.compute()` path and that `getTaskClassLoader()` fails fast rather than returning a silent `null`. Could you point me at the relevant hunk in the merge so I can close this out?
   
   **F2 – `BlockingWorker` reading the location-keyed map.** I understand `BlockingWorker` received a latch-before-lookup ordering fix. Does it now also resolve the loader from the tracker-owned context rather than the location-keyed map? If so, a pointer to that change would let me mark this resolved.
   
   **F3 – regression test coverage.** Still open as a coverage gap, though non-blocking: neither existing unit test drives the `BlockingWorker` or `CooperativeTaskWorker` path through a real worker iteration. An end-to-end test that publishes two `TaskGroupContext` generations at the same `TaskGroupLocation`, runs an older-generation task through the real worker, and asserts it resolves the older generation's loader while leaving the newer context intact would be a good follow-up.
   
   With F1/F2 confirmed, nothing else is open from my side. Thanks!
   
   <!-- streview-comment:1068 -->


-- 
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] Preserve cooperative task classloaders across restore [seatunnel]

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

   @SEZ9 Thanks for the follow-up. I re-read `TaskExecutionService.java` on head `40c6fab85` (still the head, still a pure sync with `dev`), so these are answered against that exact commit.
   
   **F1 - where the hunk is, and what a recycled context returns.**
   - `taskDone` -> `finishExecution(...)` -> `recycleClassLoader(taskGroupLocation, context)` on the tracker's own context is at `TaskExecutionService.java:1591-1599`, `:1664-1694` and `:1635-1641`; the `context.equals(activeContext)` guard sits inside `executionContexts.compute`.
   - If the tracker's own context has already been recycled, `TaskGroupExecutionTracker.getTaskClassLoader` (`:1643-1655`) does not return `null`: the loader map is `null` at that point and the method throws `IllegalStateException("Classloaders for task group ... have already been recycled")`. So that case already fails fast and is not silently installed as a null TCCL.
   - The one remaining `null` is the case where the map exists but has no entry for that task id (a task group deployed without connector jars). That is the same behavior as before this PR (the old code did `executionContexts.get(location).getClassLoaders().get(taskId)`), so I treated it as unchanged semantics rather than something this PR should alter. A WARN there would be a fair optional improvement, but I would not block on it.
   
   **F2 - `BlockingWorker`.** Confirmed. `BlockingWorker.run()` calls `startedLatch.countDown()` first (`:1284`) and then resolves the loader through `taskGroupExecutionTracker.getTaskClassLoader(t.getTaskID())` (`:1287-1288`); it no longer reads `executionContexts`. `CooperativeTaskWorker.run()` does the same at `:1421`. So non-cooperative tasks get the same fix, and the latch ordering that #12454 relies on is preserved.
   
   **F3 - tests.** `TaskExecutionServiceTest#testStaleGenerationCleanupDoesNotRecycleNewerContext` (`:615`) publishes a newer context at the shared `TaskGroupLocation`, runs `firstTracker.taskDone(...)`, and asserts the first context's loaders are nulled while the newer one stays published and resolvable. `#testCooperativeTrackerKeepsGenerationSpecificClassLoader` (`:573`) checks that each generation's tracker returns its own loader. A test that drives the real worker `run()` loops is still not there; as you said, that is a fine follow-up and I keep it non-blocking.
   
   CI on this head: the apache-side `Build` check is `SUCCESS` (fork run `37393279489`, attempt 2). My conclusion is unchanged: no source-side blockers, and a committer's final approval is the remaining step. Thanks both for the careful look!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org