You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "Asthenia0412 (via GitHub)" <gi...@apache.org> on 2026/09/29 17:26:01 UTC
[PR] [Fix][Zeta] Isolate final metrics reporting from task interrupts [seatunnel]
Asthenia0412 opened a new pull request, #12556:
URL: https://github.com/apache/seatunnel/pull/12556
### Problem
When the last task in a group completes after cancellation, final metrics reporting currently performs a synchronous Hazelcast call on the task worker. If that worker is interrupted, the socket write can close the worker's shared connection to the master and delay task-group completion.
### Changes
Run the final metrics attempt on a dedicated daemon executor, then publish the task group's terminal state after the attempt finishes. Metrics failures remain best-effort, and a regression test verifies the report runs off the interrupted worker while the terminal result waits for the attempt.
### Verification
- `./mvnw -pl seatunnel-engine/seatunnel-engine-server -Dtest=TaskExecutionServiceTest#testFinalMetricsRunOutsideInterruptedTaskWorker -DfailIfNoTests=false test`
- `./mvnw -pl seatunnel-engine/seatunnel-engine-server -Dtest=TaskExecutionServiceTest test`
- `./mvnw -pl seatunnel-engine/seatunnel-engine-server spotless:check`
- `git diff --check`
Fixes #12413.
--
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] Isolate final metrics reporting from task interrupts [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12556:
URL: https://github.com/apache/seatunnel/pull/12556#issuecomment-5924322532
Thanks for tracking this down. The mechanism described in #12413 (an interrupted `BlockingWorker` thread performing a Hazelcast socket write from `taskDone()` via `updateMetricsContextInImap()`, hitting `ClosedByInterruptException` and closing the shared worker-to-master connection) makes sense, and moving the final metrics write off the interrupted thread while completing the task-group future only after that attempt finishes is the right direction.
A few concrete asks before this can go in:
1. **Executor shutdown ordering.** Since `finalMetricsExecutorService` is a single daemon thread that is shut down in the service shutdown path, could you spell out what happens to final-metrics tasks that are already queued or still running at that moment? In particular, is every future handed to `completeAfterFinalMetrics(...)` guaranteed to complete, and is there any path where a rejected submission is swallowed without the inline `future.complete(...)` fallback running? If the current code already covers this, a short code comment plus a test would be enough.
2. **Test for the actual failure mode.** Since `updateMetricsContextInImap()` was made package-private for testing, please add (or point me to) a test that (a) calls `taskDone()` on a thread with its interrupt flag set and asserts the metrics write does not run on that thread, and (b) asserts the task-group future completes both when the metrics write throws and when submission to the executor is rejected.
3. **Scope of `completeAfterFinalMetrics`.** All of the previous `future.complete(...)` call sites in `taskDone()` now go through the helper. Could you confirm whether the non-cancel paths (normal completion and failure) also need the extra hop, or whether only the cancel path should use the executor? Either is fine, but the PR description should say which and why.
4. **Interrupt flag handling.** Please confirm the worker thread's interrupt status is left as-is (or intentionally restored) after scheduling, so later cleanup on that thread still observes it.
Happy to take another pass once these are addressed.
<!-- streview-comment:1450 -->
--
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] Isolate final metrics reporting from task interrupts [seatunnel]
Posted by "Asthenia0412 (via GitHub)" <gi...@apache.org>.
Asthenia0412 closed pull request #12556: [Fix][Zeta] Isolate final metrics reporting from task interrupts
URL: https://github.com/apache/seatunnel/pull/12556
--
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] Isolate final metrics reporting from task interrupts [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12556:
URL: https://github.com/apache/seatunnel/pull/12556#issuecomment-5976294970
Thanks for the follow-up. I re-read the updated changes and the direction still looks right to me.
The core fix is sound: `taskDone()` no longer performs the blocking `updateMetricsContextInImap()` call on the possibly-interrupted `BlockingWorker` thread, and `completeAfterFinalMetrics(...)` builds the terminal `TaskExecutionState` first, hands the Hazelcast invocation to the `seatunnel.final-metrics` daemon threads, and completes the task-group future in `finally` (or inline if the submit itself is rejected). That addresses the `ClosedByInterruptException` / shared-connection problem without letting cancellation stall behind the metrics write.
The thread-pool shape blocker from my first round is resolved with the switch to `Executors.newCachedThreadPool(...)`, and the executor is shut down in the service shutdown path.
My approval stands; nothing further needed from my side.
<!-- streview-comment:1513 -->
--
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] Isolate final metrics reporting from task interrupts [seatunnel]
Posted by "Asthenia0412 (via GitHub)" <gi...@apache.org>.
Asthenia0412 commented on PR #12556:
URL: https://github.com/apache/seatunnel/pull/12556#issuecomment-6148982397
Hi maintainers! I pushed empty commits to retrigger CI but the fork repo's Build workflow doesn't seem to be triggering on push. Only Notify test workflow and labeler show pending. Could someone help trigger the Build? 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] Isolate final metrics reporting from task interrupts [seatunnel]
Posted by "Asthenia0412 (via GitHub)" <gi...@apache.org>.
Asthenia0412 commented on PR #12556:
URL: https://github.com/apache/seatunnel/pull/12556#issuecomment-6155453029
🤖 **CI notice**: The `Build` check shows a stale failure (run ID no longer exists in GitHub Actions). This was a one-time or transient failure — please re-run CI via the Actions UI.
--
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] Isolate final metrics reporting from task interrupts [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #12556:
URL: https://github.com/apache/seatunnel/pull/12556#issuecomment-6097956367
Thanks @Asthenia0412, and thanks @SEZ9 for the follow-up. There is no open question for me on the review threads, and my approval of the source change at head 434666b060 stands.
One fact in my last review has changed, so I want to correct it. I wrote that no conflict with dev was reported at that time. GitHub now reports merge conflicts on this PR. I checked the head against the current dev: the conflict is in `TaskExecutionServiceTest.java`, where the recent change #12454 touched the same test file. `TaskExecutionService.java` itself merges cleanly.
Could you please sync with the latest dev and resolve that conflict? In addition, the apache-side `Build` check is still `action_required` ("Workflow run detection failed", https://github.com/apache/seatunnel/runs/110581259611), so no test has run on this PR yet. Pushing the sync commit should also start the workflow in your fork. If it does not start, please make sure GitHub Actions is enabled for your fork. Once CI has run, a maintainer can take it from there.
Happy to help if anything is unclear.
--
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