Backport poller b544f95#1256
Open
yuandrew wants to merge 2 commits into
Open
Conversation
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
Back port #1224 (commit 64cb6ed) onto commit b544f95 to fix poller shutdown for sdk-python 1.26.0
Why?
Back port poller shutdown fix to affected SDKs
Checklist
Note
Medium Risk
Touches core worker shutdown/polling concurrency and RPC timing; mistakes could cause hangs or premature poll termination, though changes are targeted and covered by new unit/integration tests.
Overview
Fixes a graceful shutdown deadlock by moving the
ShutdownWorkerRPC toWorker::initiate_shutdown(spawned and then awaited duringWorker::shutdown) so the server can flush in-flight long polls.Updates poller streams to treat empty poll responses after shutdown as a termination signal (instead of a timeout to retry), and refactors namespace capability flags into a shared
NamespaceCapabilitiesstruct exposed viaget_namespace_capabilities().Adds targeted unit/core tests and new shared integration tests that start active timer+activity workflows and assert shutdown completes quickly without workflow task failures; also bumps the integration-test CLI override to
v1.6.3-serverlessand enablesfrontend.enableCancelWorkerPollsOnShutdownin dev server args.Reviewed by Cursor Bugbot for commit 0155b5a. Bugbot is set up for automated code reviews on this repo. Configure here.