Skip to content

Conversation

@yuandrew
Copy link
Contributor

@yuandrew yuandrew commented Dec 9, 2025

What changed?

  • Added a new worker_instance_key field to ShutdownWorkerRequest.

Why?
We want to make sticky queue name optional, so SDK workers will always send shutdown requests (today Core only sends this request if there is a sticky queue enabled). This plus the new heartbeat info we send on shutdown means Server will now have a more accurate map of which workers are shutting down.

This should enable server to then more efficiently interrupt poll calls, instead of having to wait for the graceful shutdown timeout. (This also requires all poll requests to contain the Worker Instance Key, can be added in a future PR)

Technically this info exists in the worker heartbeat part of the message, but it needs to be lifted to its own field due to the scenario where worker heartbeating is disabled.

Breaking changes
N/A I think, just adding a new field

Server PR

@yuandrew yuandrew requested review from a team as code owners December 9, 2025 16:07
@yuandrew yuandrew marked this pull request as draft December 10, 2025 17:39
@yuandrew yuandrew marked this pull request as ready for review December 10, 2025 17:46
// Technically this is also sent in the WorkerHeartbeat, but
// since worker heartbeating can be turned off, this needs
// to be a separate, top-level field.
string worker_instance_key = 6;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're here, can you go ahead and add this to every task poll call (and get server approval to do so)? Even if server doesn't do anything with it today, I suspect it's harmless to get into SDKs as soon as we can.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants