Skip to content

Conversation

@carlydf
Copy link
Contributor

@carlydf carlydf commented Dec 10, 2025

What changed?

Expose poller error on max deployments instead of masking it as internal

Why?

Users should see this. https://temporaltechnologies.slack.com/archives/C02LGH6BG3A/p1764816658963239

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

Any change is risky. Identify all risks you are aware of. If none, remove this section.


Note

Surfaces the "too many worker deployments in namespace" error to pollers and standardizes the error message used when the max deployments limit is exceeded.

  • Matching Service
    • Avoid masking worker deployment registration errors: if error contains workerdeployment.ErrTooManyDeploymentsInNamespacePrefix, return it directly instead of errDeploymentVersionNotReady in physical_task_queue_manager.ensureRegisteredInDeploymentVersion.
  • Worker Deployment
    • Introduce standardized error strings: ErrTooManyDeploymentsInNamespacePrefix and errTooManyDeploymentsInNamespace in service/worker/workerdeployment/util.go.
    • Use the standardized message when rejecting new deployments that exceed per-namespace limits in client.updateWithStartWorkerDeployment.

Written by Cursor Bugbot for commit 4f9a8ba. This will update automatically on new commits. Configure here.

@carlydf carlydf requested review from a team as code owners December 10, 2025 01:51
@carlydf carlydf marked this pull request as draft December 10, 2025 01:51
if !errors.As(err, &errResourceExhausted) {
if strings.Contains(err.Error(), workerdeployment.ErrTooManyDeploymentsInNamespacePrefix) {
return err
}
Copy link

Choose a reason for hiding this comment

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

Bug: Unreachable code: check is inside wrong conditional branch

The new check for ErrTooManyDeploymentsInNamespacePrefix is placed inside the if !errors.As(err, &errResourceExhausted) block, meaning it only executes when the error is NOT a *serviceerror.ResourceExhausted. However, the "too many deployments" error is created via newResourceExhaustedError() which returns a *serviceerror.ResourceExhausted. Therefore, errors.As will return true for this error, the condition !errors.As(...) will be false, and this new code block will never execute for the intended error case. The check needs to be moved outside or before the !errors.As conditional.

Fix in Cursor Fix in Web

if !errors.As(err, &errResourceExhausted) {
if strings.Contains(err.Error(), workerdeployment.ErrTooManyDeploymentsInNamespacePrefix) {
return err
}
Copy link

Choose a reason for hiding this comment

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

Bug: Unreachable code: check is inside wrong conditional branch

The new check for ErrTooManyDeploymentsInNamespacePrefix is placed inside the if !errors.As(err, &errResourceExhausted) block, meaning it only executes when the error is NOT a *serviceerror.ResourceExhausted. However, the "too many deployments" error is created via newResourceExhaustedError() which returns a *serviceerror.ResourceExhausted. Therefore, errors.As will return true for this error, the condition !errors.As(...) will be false, and this new code block will never execute for the intended error case. The check needs to be moved outside or before the !errors.As conditional.

Fix in Cursor Fix in Web

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