numaflow-java icon indicating copy to clipboard operation
numaflow-java copied to clipboard

gracefully shutdown AKKA threads when user error encountered

Open KeranYang opened this issue 1 year ago • 0 comments

Currently we are using System.exit(0)

https://github.com/numaproj/numaflow-java/blob/main/src/main/java/io/numaproj/numaflow/mapper/Server.java#L96

Without System.exit(0) the shutdown will hang because there is lingering AKKA thread. To reproduce the issue, remove System.exit, you can write an error mapper and deploy the pipeline, you can see the mapper container doesn't get restarted immediately. Instead, it wait for numa container health check to determine it's not healthy and then terminate, which takes around 5 minutes to happen.

Another quick way to reproduce is simply to run the mapper/transformer server test from IDE. You can see the test succeeds but not stops. Generate a thread dump and you should see it's AKKA thread hanging.

KeranYang avatar Nov 06 '24 21:11 KeranYang