no longer cancel pending polls on shutdown#1122
Merged
yuandrew merged 4 commits intotemporalio:masterfrom Feb 23, 2026
Merged
Conversation
chris-olszewski
requested changes
Feb 20, 2026
Member
chris-olszewski
left a comment
There was a problem hiding this comment.
Makes sense to me, but I think we want to keep respecting TEMPORAL_POLL_SHUTDOWN_INTERRUPT_WAIT_MS set by users in the case that worker_poll_complete_on_shutdown isn't supported. Not sure how widely this was advertised, but it did make it into Python release notes
| #[cfg(test)] | ||
| let poll_shutdown_interrupt_wait = POLL_SHUTDOWN_INTERRUPT.with(|v| *v.borrow()); | ||
| #[cfg(not(test))] | ||
| let poll_shutdown_interrupt_wait = |
Member
There was a problem hiding this comment.
Should this be preserved when worker_poll_complete_on_shutdown isn't supported? Maybe even warn if this is set by the user, but won't be used.
Contributor
Author
There was a problem hiding this comment.
yeah that's a good point, even though our new solution fixes things, we want the old solution for older server versions
chris-olszewski
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
If
worker_poll_complete_on_shutdownnamespace capability exists, then don't cancel outstanding poll requests on shutdown. Instead expect server to return an empty result.Why?
During worker shutdown, the SDK cancels outstanding poll requests client-side by racing them against the shutdown token. This
creates a race condition: the server may dispatch a task to a poll at the same instant the SDK kills the connection, orphaning the
task until start_to_close timeout.
Checklist
Closes
How was this tested:
Added new test verifying graceful shutdown behavior
Note
Medium Risk
Touches generated/public OpenAPI surface area (path reshapes and endpoint additions/removals), which can break client integrations; the new CI guard is low risk but may block builds if it flags previously unnoticed conflicts.
Overview
Updates the generated OpenAPI v2 spec to restructure activity-related REST endpoints, introducing
.../activities/{activityId}/...routes (e.g.cancel,terminate,outcome,complete/fail/heartbeat) while moving older pause/reset/unpause/update-options routes under anactivities-deprecatedprefix and adding top-levelactivity-*worker-style endpoints.Removes the experimental
workflows/execute-multi-operationAPI from the OpenAPI spec and adjusts several schema definitions/fields (including new namespace capabilityworkerPollCompleteOnShutdownand related enum/fields changes).Adds a Go-based CI step (
cmd/check-path-conflicts) that fails the build when the OpenAPI spec contains ambiguous path patterns (literal vs parameter segment collisions).Written by Cursor Bugbot for commit 41246e8. This will update automatically on new commits. Configure here.