-
Notifications
You must be signed in to change notification settings - Fork 78
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
Call ShutdownWorker API on worker shutdown #843
Conversation
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.
Just a few minor things
core/src/core_tests/workers.rs
Outdated
#[tokio::test] | ||
async fn worker_shutdown_non_sticky() { |
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.
All three of these tests share a lot of code and could be combined using the rstest
macro - check out the other places that's used to get an idea of how to do it.
core/src/worker/mod.rs
Outdated
@@ -470,6 +470,11 @@ impl Worker { | |||
/// completed | |||
async fn shutdown(&self) { | |||
self.initiate_shutdown(); | |||
// Call shutdownWorker API to initiate server side shutdown |
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.
Can just get rid of this comment. Comments of the form "I'm about to do X" followed by a very easily-read "X" are usually unnecessary.
sdk-core-protos/Cargo.toml
Outdated
@@ -30,7 +31,7 @@ uuid = { version = "1.1", features = ["v4"], optional = true } | |||
|
|||
[build-dependencies] | |||
tonic-build = { workspace = true } | |||
prost-build = "0.13" | |||
prost-build = "0.11.7" |
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.
Why did this roll back?
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.
Sweet, thanks!
core/src/worker/mod.rs
Outdated
// This is a best effort call and we can still shutdown the worker if it fails | ||
let _ = self.client.shutdown_worker(name).await; |
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 think we should warn if this is any Err
except Unavailable
(maybe dbg_panic too). Otherwise this is the type of thing that will just stop working and we'll never know.
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.
good point!
What was changed
Added a new call to ShutdownWorker that was recently implemented in the server.
Why?
New server feature already implemented in Go and Java, implementing in core to match.
Checklist
Closes [Feature Request] Call ShutdownWorker API on worker shutdown #822
How was this tested:
Add tests to verify when API is called