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: [email protected]

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

Reply via email to