Skip to content

Pass unset poller behavior to core so workers can auto-enroll in poller autoscaling - #647

Merged
chris-olszewski merged 6 commits into
mainfrom
vpatel/poller-autoscaling-auto-enroll
Nov 5, 2026
Merged

chris-olszewski merged 6 commits into
mainfrom
vpatel/poller-autoscaling-auto-enroll

Conversation

@veeral-patel

@veeral-patel veeral-patel commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

  • Poller behavior and max_concurrent_*_task_polls options default to nil; an unset behavior is passed to core as None.
  • If the namespace auto-enrolls, core uses autoscaling; otherwise it falls back to the same 5-poller maximum.
  • An explicit poller behavior or poll count still wins and opts out. RBS/RBI signatures now allow nil.

Why?

When a namespace has poller autoscaling auto-enroll turned on, sdk-core switches any poller the user left unset to autoscaling. This SDK filled in its own default before calling core, so every poller looked explicitly configured and nothing was ever enrolled. Go, Java and Rust already pass "unset" through.

Auto-enroll was added to sdk-core in temporalio/sdk-rust#1425, but it never took effect in this SDK because of this double default (the SDK applied its own default, so core never saw the poller as unset).

Checklist

  1. Closes
  2. How was this tested: existing CI suite (including the runtime signature checks). Happy to add an auto-enroll integration test like the Python one.
  3. Any docs updates needed? YARD docs updated.

Manual testing

Local dev server with frontend.pollerAutoscalingAutoEnroll=true (namespace advertises the capability); poller autoscaling read from the worker heartbeat via ListWorkers.

Build Worker config Workflow / activity pollers autoscaling
main (48450e1) default ❌ false / false
this PR (6746c18) default ✅ true / true
this PR max_concurrent_workflow_task_polls: 5 false / true (workflow opted out, activity still enrolls)
this PR workflow_task_poller_behavior: SimpleMaximum.new(5) false / true

Nexus pollers were already enrolled on main (Ruby never set a Nexus poller behavior), so they're unchanged.

…er autoscaling

When the user sets neither a poller behavior nor a max poll count, pass nil
through the bridge instead of a SimpleMaximum(5) default. sdk-core then enrolls
the poller into autoscaling when the namespace advertises the
poller_autoscaling_auto_enroll capability, and falls back to SimpleMaximum(5)
otherwise. Explicitly configured behaviors are passed through unchanged.
@veeral-patel
veeral-patel requested a review from a team as a code owner November 3, 2026 02:39

@chris-olszewski chris-olszewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Just make sure to fixup the documented defaults and add a changelog fragment since this is a user facing change.

Comment thread temporalio/lib/temporalio/worker.rb Resolved
Comment thread temporalio/lib/temporalio/worker.rb Resolved
@veeral-patel veeral-patel added skip-changelog PR changes do not require changelog updates and removed skip-changelog PR changes do not require changelog updates labels Nov 4, 2026
@veeral-patel

Copy link
Copy Markdown
Contributor Author

@cla-assistant check

@chris-olszewski
chris-olszewski merged commit 60ea81a into main Nov 5, 2026
12 checks passed
@chris-olszewski
chris-olszewski deleted the vpatel/poller-autoscaling-auto-enroll branch November 5, 2026 13:15
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.

2 participants