Skip to content

Handle unavailable ShutdownWorker during graceful poll shutdown#1298

Open
noqcks wants to merge 4 commits into
temporalio:mainfrom
noqcks:noqcks/shutdown-worker-unimplemented-fallback
Open

Handle unavailable ShutdownWorker during graceful poll shutdown#1298
noqcks wants to merge 4 commits into
temporalio:mainfrom
noqcks:noqcks/shutdown-worker-unimplemented-fallback

Conversation

@noqcks

@noqcks noqcks commented May 27, 2026

Copy link
Copy Markdown

Ticket

Fixes #1297.

Problem

When DescribeNamespace reports worker_poll_complete_on_shutdown=true, sdk-core enables graceful poll shutdown and lets in-flight long polls wait for server-side completion after ShutdownWorker. If ShutdownWorker returns UNIMPLEMENTED or UNAVAILABLE, that server-assisted path is unavailable, but the in-flight activity poll can still wait forever and poll_activity_task() never returns PollError::ShutDown.

Solution

This draft adds a deterministic activity-only regression test. On ShutdownWorker UNIMPLEMENTED/UNAVAILABLE, the worker disables the existing graceful poll capability. LongPollBuffer keeps normal graceful behavior, but after local shutdown it observes that capability transition and lets the in-flight poll return shutdown instead of waiting forever.

Design question: is observing the existing capability from LongPollBuffer acceptable, or should this be a more explicit poll-buffer shutdown signal?

Artifacts (if appropriate):

N/A.

@CLAassistant

CLAassistant commented May 27, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@noqcks noqcks marked this pull request as ready for review May 27, 2026 17:59
@noqcks noqcks requested a review from a team as a code owner May 27, 2026 17:59
@noqcks noqcks changed the title WIP: Handle unavailable ShutdownWorker during graceful poll shutdown Handle unavailable ShutdownWorker during graceful poll shutdown May 27, 2026
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.

Activity poll can hang during shutdown when ShutdownWorker returns UNIMPLEMENTED

2 participants