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

   ## Problem
   
   When a task group is canceled, its last task can call 
`updateMetricsContextInImap()` from an interrupted task worker. The synchronous 
Hazelcast socket write may then close the worker's shared connection to the 
master and delay terminal completion.
   
   ## Change
   
   Run the final metrics attempt on a dedicated daemon executor so it does not 
inherit the task worker's interrupt status. Publish the task group's terminal 
state after the metrics attempt finishes. This ordering applies to FINISHED, 
CANCELED, and FAILED task groups so their completion behavior stays consistent. 
Metrics reporting is best-effort; a report failure or rejected submission still 
completes the terminal future, and orderly executor shutdown drains reports 
already accepted.
   
   ## Verification
   
   - `./mvnw -pl seatunnel-engine/seatunnel-engine-server 
-Dtest=TaskExecutionServiceTest#testFinalMetricsRunOutsideInterruptedTaskWorker+testFinalMetricsFailurePreservesFailedTerminalState+testFinalMetricsExecutorRejectionStillCompletesTerminalState
 -DfailIfNoTests=false test` (3 tests passed on Java 8)
   - `./mvnw -pl seatunnel-engine/seatunnel-engine-server spotless:apply`
   - `git diff --check`
   
   Fixes #12413.
   
   > Rebased from closed PR #12556 onto latest `dev` branch (fork 
Actions-disabled issue prevented CI from running on the original 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to