Backport poller 5f79ef2#1260
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 5f79ef2 to fix poller shutdown for sdk-python 1.26.0
Why?
Back port poller shutdown fix to affected SDKs
Checklist
Note
Medium Risk
Changes worker shutdown sequencing and poller termination behavior; mistakes could cause hangs or premature poll termination under load, but changes are scoped and covered by new unit/integration tests.
Overview
Fixes a graceful shutdown deadlock by moving the
ShutdownWorkerRPC toWorker::initiate_shutdown(spawned once and awaited duringWorker::shutdown) so the server is signaled to flush in-flight long polls.Updates poller streams to treat an empty poll response after shutdown as a graceful-termination signal (instead of a poll timeout to retry), and centralizes namespace capability state in a new exported
NamespaceCapabilities.Adds targeted unit/core/integration/shared tests (and enables the needed server dynamic config) to verify the RPC is sent during initiate and shutdown completes quickly during active timer+activity workloads; also bumps the integration-test CLI override to
v1.6.3-serverless.Reviewed by Cursor Bugbot for commit a627b33. Bugbot is set up for automated code reviews on this repo. Configure here.