Skip to content

gracefully shutdown AKKA threads when user error encountered #155

@KeranYang

Description

@KeranYang

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions