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, as well as all other poll calls.
  • Added comment to ShutdownWorkerRequest.sticky_task_queue saying it may be blank, now that we've expanded the scope of when ShutdownWorkerRequest is called.
  • Added task_queue and task_queue_kind to ShutdownWorkerRequest

Why?
ShutdownWorker was changed to always be sent by SDK (temporalio/sdk-core#1082), so sticky queue name is now optional. 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.

Adding task queue and task_queue_kind should also allow us to fix a lost task issue, where there is a race when the SDK cancels an outstanding poll rpc and the server decides to send a task to that poller.

Technically some of 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 new fields

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
@yuandrew yuandrew changed the title Add comments on ShutdownWorkerRequest specifying sticky queue name being optional Add worker_instance_key to shutdown and poll calls, enhance ShutdownWorkerRequest with task queue and task queue kind Jan 23, 2026
@yuandrew yuandrew changed the title Add worker_instance_key to shutdown and poll calls, enhance ShutdownWorkerRequest with task queue and task queue kind Enhance ShutdownWorkerRequest and poll calls with worker_instance_key Jan 23, 2026
Copy link

@rkannan82 rkannan82 left a comment

Choose a reason for hiding this comment

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

LGTM. Do we need to add this to PollNexusTaskQueueRequest as well? Not specifically for the server initiated shutdown.

Copy link
Contributor

@dnr dnr left a comment

Choose a reason for hiding this comment

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

update PR description to remove/rewrite

(This also requires all poll requests to contain the Worker Instance Key, can be added in a future PR)

since it's here now

@yuandrew yuandrew merged commit 6584b8b into temporalio:master Jan 23, 2026
4 checks passed
@yuandrew yuandrew deleted the shutdown-worker-comments branch January 23, 2026 20:39
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.

5 participants