Skip to content

Fix async poller workflow slot used#2803

Open
jjaegerman wants to merge 2 commits intotemporalio:masterfrom
jjaegerman:fix-async-poller-workflow-slot-used
Open

Fix async poller workflow slot used#2803
jjaegerman wants to merge 2 commits intotemporalio:masterfrom
jjaegerman:fix-async-poller-workflow-slot-used

Conversation

@jjaegerman
Copy link

What was changed

  • AsyncWorkflowPollTask calls markSlotUsed on the SlotSupplier when a task is received

Why?

  • This is behavior that is present in WorkflowPollTask but missing in AsyncWorkflowPollTask
  • This ensures that TrackingSlotSupplier's usedSlots gets updated when PollerBehaviorAutoscaling is enabled
  • usedSlots is used to report WORKER_TASK_SLOTS_AVAILABLE
  • This fixes the incorrect WORKER_TASK_SLOTS_AVAILABLE value problem described in the issue when PollerBehaviorAutoscaling is enabled

Note:

  • markSlotUsed is handled by the worker Implementation for Activity and Nexus paths (instead of the poll task)
  • This behavior cannot be easily moved from WorkflowPollTask to WorkflowWorker because WorkflowWorker cannot easily determine if the task is the result of a poll to a sticky task queue or normal task queue (needed for the fromStickyQueue field)

Checklist

  1. Closes #2802

  2. How was this tested: New SlotSupplierTest covers this case (this is where the equivalent synchronous WorkflowPollTask behavior is tested)

  3. Any docs updates needed?
    No

@jjaegerman jjaegerman requested a review from a team as a code owner March 6, 2026 22:53
@CLAassistant
Copy link

CLAassistant commented Mar 6, 2026

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Jonathan Jaegerman seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jjaegerman jjaegerman force-pushed the fix-async-poller-workflow-slot-used branch from 6d7ed63 to e510a14 Compare March 6, 2026 23:05
@jjaegerman jjaegerman force-pushed the fix-async-poller-workflow-slot-used branch from e510a14 to 5c8fce6 Compare March 6, 2026 23:11
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.

WORKER_TASK_SLOTS_AVAILABLE stuck at zero when PollerBehaviorAutoscaling enabled

2 participants