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_r324297838
##########
File path:
samza-core/src/main/java/org/apache/samza/runtime/ContainerLaunchUtil.java
##########
@@ -132,6 +136,10 @@ private static void run(
container.setContainerListener(
new SamzaContainerListener() {
Review comment:
Could we add some unit tests for this? This anonymous class is getting
pretty complex. Maybe this is also a good time to pull it out into its own
class.
You'll have to be a little careful since you don't actually want to add a
real shutdown hook to the test process though. One way you could do it is to
pull `Runtime.getRuntime().addShutdownHook` and
`Runtime.getRuntime().removeShutdownHook` into internal helper methods and then
use a spy to mock those internal methods. And then maybe you could capture the
shutdown hook thread using Mockito and call it directly when necessary.
----------------------------------------------------------------
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