Skip to content

Don't install a shutdown hook by default #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lburgazzoli opened this issue Jun 13, 2021 · 0 comments · Fixed by #498
Closed

Don't install a shutdown hook by default #434

lburgazzoli opened this issue Jun 13, 2021 · 0 comments · Fixed by #498

Comments

@lburgazzoli
Copy link
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();
lburgazzoli added a commit to lburgazzoli/java-operator-sdk that referenced this issue Jun 13, 2021
lburgazzoli added a commit to lburgazzoli/java-operator-sdk that referenced this issue Jun 13, 2021
lburgazzoli added a commit to lburgazzoli/java-operator-sdk that referenced this issue Jun 13, 2021
lburgazzoli added a commit to lburgazzoli/java-operator-sdk that referenced this issue Jun 13, 2021
metacosm pushed a commit that referenced this issue Aug 19, 2021
metacosm pushed a commit that referenced this issue Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant