-
Notifications
You must be signed in to change notification settings - Fork 218
feat: graceful shutdown #1735
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
feat: graceful shutdown #1735
Conversation
This might deserve also an end to end test, to showcase, how SIGTERM and SIGKILL works in pods. WDYT @metacosm ? |
// this is needed for the case when controller stopped, but there is a graceful shutdown | ||
// timeout. that should finish the currently executing reconciliations but not the ones | ||
// which where submitted but not started yet | ||
log.debug("Event processor not running skipping resource processing: {}", resourceID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this missing a return statement here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, wonder how the test passed, will check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed the unit test, was not trivial, wonder if we should refactor this in the future.
@@ -121,6 +121,7 @@ public HasMetadata clone(HasMetadata object) { | |||
* | |||
* @return the number of seconds to wait before terminating reconciliation threads | |||
*/ | |||
@Deprecated(forRemoval = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs an associated @deprecated
tag in the javadoc…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
ef81c22
to
1c62152
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from question regarding deprecation of termination timeout
@@ -121,8 +121,12 @@ public HasMetadata clone(HasMetadata object) { | |||
* Retrieves the number of seconds the SDK waits for reconciliation threads to terminate before | |||
* shutting down. | |||
* | |||
* @deprecated use {@link io.javaoperatorsdk.operator.Operator#stop(Duration)} instead. Where the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: why not keep this? It could be useful to be able to configure the default timeout as previously…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to have a single way to configure this, and it is much simpler with the parameters. Keeping this, would be two way to do the same thing.
[skip ci]
[skip ci]
52ec2ce
to
430b1af
Compare
Kudos, SonarCloud Quality Gate passed! |
No description provided.