cameronlee314 commented on a change in pull request #1151: [SAMZA-2198] Fix
deadlock in container signal handler
URL: https://github.com/apache/samza/pull/1151#discussion_r324294171
##########
File path:
samza-core/src/main/java/org/apache/samza/runtime/ContainerLaunchUtil.java
##########
@@ -142,19 +150,59 @@ public void beforeStart() {
public void afterStart() {
log.info("Container Started");
listener.afterStart();
+ addShutdownHook();
}
@Override
public void afterStop() {
log.info("Container Stopped");
listener.afterStop();
+ removeShutdownHook();
+ shutdownLatch.countDown();
Review comment:
Can you please double check that either `afterStop` or `afterFailure` will
always be called, even in failure cases? Ideally, the shutdown timeout is only
hit because some part of the shutdown was taking a long time, but not because
there was some flow which accidentally forgot to call the callback.
I think you are good here, but just double checking.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services