Skip to content

Make jooby 2 stop idempotent #1351

@agentgt

Description

@agentgt

If jooby.stop is called twice a null pointer exception is thrown:

java.lang.NullPointerException
        at io.jooby.internal.RouterImpl.destroy(RouterImpl.java:430)
        at io.jooby.Jooby.stop(Jooby.java:642)
...

I'm assuming somewhere jooby 2.0 registers a java.lang.Runtime shutdown hook. Ignoring various race conditions our problem is we will shutdown all services that need shutdown on the Runtime hook as well.

We could differentiate from runtime shutdown and manual shutdown of the service but that would not be desirable as it would probably be brittle (again race conditions).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions