Skip to content

Auto-enroll pollers into autoscaling on PollerAutoscalingAutoEnroll (Java SDK)#2953

Open
veeral-patel wants to merge 1 commit into
mainfrom
veeral/poller-autoscaling-auto-enroll
Open

Auto-enroll pollers into autoscaling on PollerAutoscalingAutoEnroll (Java SDK)#2953
veeral-patel wants to merge 1 commit into
mainfrom
veeral/poller-autoscaling-auto-enroll

Conversation

@veeral-patel

@veeral-patel veeral-patel commented Jul 15, 2026

Copy link
Copy Markdown

Mirrors the Go SDK (temporalio/sdk-go#2442).

What

When a namespace advertises the PollerAutoscalingAutoEnroll capability, workers automatically use poller autoscaling for any poller type left at its default — i.e. where the user set neither MaxConcurrent<Type>TaskPollers nor a <Type>TaskPollerBehavior. Explicitly configured pollers are left alone. Applies to workflow, activity, and nexus pollers.

How

  • Worker records, per poller type, whether it was left at its default (read from the raw WorkerOptions, before defaults are applied).
  • At start() — once namespace capabilities are known — each eligible poller's behavior is swapped to autoscaling before its poller is created.
  • Auto-enroll also implies scale-down support, so NamespaceCapabilities treats it as enabling pollerAutoscaling too.

Proto

Bumps the temporal/api submodule to pick up the poller_autoscaling_auto_enroll capability (api #803).

Testing

  • PollerAutoscalingAutoEnrollTest — the enroll decision (default + capability → autoscaling; capability off, explicit count, or explicit behavior → unchanged).
  • WorkerPollerAutoEnrollEligibilityTestWorker marks defaults eligible and explicit config ineligible, per type.
  • Existing poller/worker tests still pass.

When a namespace advertises the PollerAutoscalingAutoEnroll capability,
automatically switch a poller type to poller autoscaling if the user left
it at its default (set neither MaxConcurrent<Type>TaskPollers nor a
<Type>TaskPollerBehavior). Explicitly configured pollers are untouched.

Auto-enroll implies full autoscaling support, so it also enables
serverSupportsAutoscaling (scale-down). Applies to workflow, activity, and
nexus pollers.

The decision is made at worker start(), after namespace capabilities are
loaded, by rebuilding each dormant worker's PollerOptions before its poller
is created. Per-poller-type eligibility is captured at Worker construction
from the raw (pre-defaulting) WorkerOptions and threaded through
PollerOptions.

Also bumps the temporal/api proto submodule to pick up the
poller_autoscaling_auto_enroll namespace capability (api #803).
@veeral-patel
veeral-patel requested a review from a team as a code owner July 15, 2026 21:17
@veeral-patel
veeral-patel marked this pull request as draft July 15, 2026 21:19
@veeral-patel veeral-patel changed the title Auto-enroll pollers into autoscaling on PollerAutoscalingAutoEnroll Auto-enroll pollers into autoscaling on PollerAutoscalingAutoEnroll (Java SDK) Jul 16, 2026
@veeral-patel
veeral-patel marked this pull request as ready for review July 17, 2026 17:45
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.

1 participant