rainerschamm commented on PR #17350:
URL: https://github.com/apache/iceberg/pull/17350#issuecomment-5132090886

   > Thank you for reporting this in #17349 and for following up with the fix 
in #17350. It looks like we independently ran into the same coordinator 
shutdown issue.
   > 
   > I reviewed both #17349 and #17350, and I believe #16843 already covers the 
reported failure mode. #16843 makes `CoordinatorThread.terminate()` wait for 
the coordinator thread to exit, so the shutdown path reaches 
`coordinator.stop()` before task shutdown continues. It also checks whether the 
thread is still alive after the timeout and propagates interruption or 
termination failures.
   
   
   Cool, yes I did see the coordinator thread join logic. I am finding it 
slightly harder to review though. It seems easier to understand to me if the 
orchestrator or "owner" of the thread also does the join(). 
   
   ```java
         coordinatorThread = new CoordinatorThread(coordinator);
         coordinatorThread.start();
   ```
   
   ```java
       if (coordinatorThread != null) {
         coordinatorThread.terminate();
         try {
           LOG.info("Asking coordinator thread to join for task {}", taskId);
           
coordinatorThread.join(COORDINATOR_THREAD_JOIN_WAIT_DURATION.toMillis());
           LOG.info("Coordinator thread joined for task {}", taskId);
         } catch (InterruptedException e) {
           LOG.warn("Coordinator thread join interrupted for task {}", taskId, 
e);
         }
         coordinatorThread = null;
       }
   ```
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to