Skip to content

Stop pinning the initial autoscaling poller count to the max in omes worker - #468

Open
veeral-patel wants to merge 4 commits into
mainfrom
poller-autoscale-min-initial-flags
Open

Stop pinning the initial autoscaling poller count to the max in omes worker#468
veeral-patel wants to merge 4 commits into
mainfrom
poller-autoscale-min-initial-flags

Conversation

@veeral-patel

@veeral-patel veeral-patel commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What was changed

--worker-{activity,workflow}-poller-autoscale-max=N set InitialNumberOfPollers as well as MaximumNumberOfPollers, so the flag quietly fixed the starting poller count at the ceiling. Dropping the two assignments lets the SDK apply its own initial default.

  options.ActivityTaskPollerBehavior = sdkworker.NewPollerBehaviorAutoscaling(sdkworker.PollerBehaviorAutoscalingOptions{
-     InitialNumberOfPollers: args.ActivityPollerAutoscaleMax,
      MaximumNumberOfPollers: args.ActivityPollerAutoscaleMax,
  })

and the same in the workflow-poller-autoscale-max block.

Previous code was a workaround to a SDK bug that's been since fixed.

Will this cause a inconsistency with the omes workers in other languages?

No - I checked the other workers: Go is the only one coupling initial to max.

Harness Call Sets initial?
Python PollerBehaviorAutoscaling(maximum=…) (worker.py:233) no
TypeScript {type: 'autoscaling', maximum: …} (worker.ts:250) no
Java new PollerBehaviorAutoscaling(null, max, null) (WorkerHarness.java:149) no — positional (min, max, initial)
.NET new PollerBehavior.Autoscaling(maximum: …) (Worker.cs:346) no
Ruby PollerBehavior::Autoscaling.new(maximum: …) (worker.rb:129) no
Go (before) {InitialNumberOfPollers: max, MaximumNumberOfPollers: max} yes

⚠️ Behavior change

Below -max=5 you get initial=5, max=3: the SDK doesn't validate initial <= max and stores the initial target unclamped (internal_worker_base.go:956), so the worker transiently exceeds its own maximum. Verified not to error.

Nothing in this repo passes these flags. External command lines might be affected, if they are relying on initial being set to max. However, this should be rare as this is unexpected and incorrect behavior.

How was this tested

  • Build, vet and tests pass

@veeral-patel
veeral-patel requested review from a team as code owners September 5, 2026 02:51
@veeral-patel veeral-patel changed the title Add min/initial poller autoscaling flags to the Go worker harness Add missing min/initial poller autoscaling flags to the Go worker Sep 5, 2026
Comment thread docs/running.md Outdated
Comment thread docs/running.md Outdated
--activity-poller-autoscale-max and --workflow-poller-autoscale-max set
InitialNumberOfPollers as well as MaximumNumberOfPollers, so the flag
quietly fixes the starting poller count at the ceiling. Every other
harness sets only the maximum - Python (worker.py:233), TypeScript
(worker.ts:250), Java (WorkerHarness.java:149), .NET (Worker.cs:346) and
Ruby (worker.rb:129) - so the same flag means different things depending
on --language.

Drop the two InitialNumberOfPollers assignments and let the SDK apply its
own initial default, as the other five harnesses already do.

Behavior change: --*-poller-autoscale-max=N no longer starts N pollers
immediately. It starts at the SDK default and scales up to N, so a
-max-only command line begins with fewer pollers than before.

Adds TestBuildWorkerOptionsPollerBehavior, which had no coverage.
@veeral-patel
veeral-patel force-pushed the poller-autoscale-min-initial-flags branch from c61b327 to 9d9371b Compare September 5, 2026 05:31
@veeral-patel veeral-patel changed the title Add missing min/initial poller autoscaling flags to the Go worker Stop pinning the initial poller count to the autoscaling max Sep 5, 2026
@veeral-patel veeral-patel changed the title Stop pinning the initial poller count to the autoscaling max Stop pinning the initial autoscaling poller count to the max in omes worker Sep 5, 2026
rkannan82 and others added 2 commits September 6, 2026 11:47
@temporalio/common@1.23.0 requires protobufjs/ext/protojson which
was added in 7.5.2. The pinned 7.5.1 caused "Cannot find module"
errors in every kitchensink test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rkannan82
rkannan82 force-pushed the poller-autoscale-min-initial-flags branch 3 times, most recently from 7c9217e to bddd53f Compare September 8, 2026 14:37
@rkannan82
rkannan82 enabled auto-merge (squash) September 8, 2026 14:41
@rkannan82
rkannan82 disabled auto-merge September 8, 2026 14:41
Picks up temporalio/features#892 which bumps the protobufjs pnpm
override from 7.5.1 to ^8.7.1, fixing TS kitchensink CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rkannan82
rkannan82 force-pushed the poller-autoscale-min-initial-flags branch from bddd53f to a690286 Compare September 8, 2026 17:08
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.

3 participants