Skip to content

Don't install a shutdown hook by default #434

Closed
@lburgazzoli

Description

@lburgazzoli
Collaborator

When the Operator class is instantiated, it automatically registers a shutdown hook:

Runtime.getRuntime().addShutdownHook(new Thread(this::close))

As the startup of the operator is responsibility of the operator developer, I think the shutdown should be left to the user otherwise there may be some conflict and undefined behavior because there may be the need to perform some logic before the operator shuts down.

I'm proposing to make this behavior explicit, like

operator.installShutdownHook();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @lburgazzoli

      Issue actions

        Don't install a shutdown hook by default · Issue #434 · operator-framework/java-operator-sdk