Skip to content

Add completed_by_worker_shutdown field to poll responses#730

Open
rkannan82 wants to merge 4 commits intomasterfrom
kannan/poll-shutdown-rejected-field
Open

Add completed_by_worker_shutdown field to poll responses#730
rkannan82 wants to merge 4 commits intomasterfrom
kannan/poll-shutdown-rejected-field

Conversation

@rkannan82
Copy link
Copy Markdown
Contributor

@rkannan82 rkannan82 commented Mar 17, 2026

What changed?

Add completed_by_worker_shutdown bool field to PollWorkflowTaskQueueResponse, PollActivityTaskQueueResponse, and PollNexusTaskQueueResponse.

Why?

When the server completes a poll because the worker was shut down via ShutdownWorker, SDKs currently receive an empty response indistinguishable from a normal poll timeout. This gives SDKs an explicit signal to stop re-polling, and is useful for debugging.

How did you test it?

  • built
  • server-side implementation in separate PR

Potential risks

None — additive proto field, fully backward compatible.

Add a bool field to PollWorkflowTaskQueueResponse, PollActivityTaskQueueResponse,
and PollNexusTaskQueueResponse to indicate when an empty poll response was caused
by the server rejecting the poll because the worker has been shut down via the
ShutdownWorker API.

Made-with: Cursor
Copy link
Copy Markdown
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.

Does it make more sense to do this with a specific grpc error code instead? Maybe NotFound or FailedPrecondition? Something that would make old SDKs abort or at least back off?

@rkannan82 rkannan82 requested a review from Sushisource April 10, 2026 22:29
@rkannan82 rkannan82 marked this pull request as draft April 10, 2026 22:31
@rkannan82 rkannan82 changed the title Add shutdown_worker_rejected field to poll responses Add completed_by_worker_shutdown field to poll responses Apr 10, 2026
@rkannan82 rkannan82 force-pushed the kannan/poll-shutdown-rejected-field branch from f7ea4d9 to 4993846 Compare April 10, 2026 22:43
@rkannan82
Copy link
Copy Markdown
Contributor Author

Does it make more sense to do this with a specific grpc error code instead? Maybe NotFound or FailedPrecondition? Something that would make old SDKs abort or at least back off?

We agreed to not introduce a new error as this interferes with older sdks.

@rkannan82 rkannan82 marked this pull request as ready for review April 10, 2026 22:43
rkannan82 and others added 2 commits April 10, 2026 15:57
Aligns the field name with the ShutdownWorker capability name and
removes ambiguity from the old name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rkannan82 rkannan82 force-pushed the kannan/poll-shutdown-rejected-field branch from 4993846 to d3b45e9 Compare April 10, 2026 22:58
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