Skip to content

fix(worker): honour temporal-max-parallel-activities flag (EN-1228) - #191

Closed
flemzord wants to merge 1 commit into
mainfrom
fix/temporal-max-parallel-activities-flag
Closed

fix(worker): honour temporal-max-parallel-activities flag (EN-1228)#191
flemzord wants to merge 1 commit into
mainfrom
fix/temporal-max-parallel-activities-flag

Conversation

@flemzord

Copy link
Copy Markdown
Member

Problem (H9 — HIGH)

temporalMaxParallelActivities, _ := cmd.Flags().GetInt(temporal.TemporalMaxParallelActivitiesFlag)
...
worker.Options{ TaskQueueActivitiesPerSecond: float64(temporalMaxParallelActivities) }

The flag is registered as a float64 in go-libs (temporal/cli.go). GetInt on a float64 flag returns an error (discarded) and 0, so the worker option was always 0 (Temporal default = unlimited) — the operator-configured limit never applied. Separately, "max parallel activities" is a concurrency cap, which maps to MaxConcurrentActivityExecutionSize, not the queue-wide rate limit TaskQueueActivitiesPerSecond.

Fix

  • Read the flag with GetFloat64.
  • Wire it to MaxConcurrentActivityExecutionSize.

Behavioural note: the default (10) now actually caps activity concurrency where it previously had no effect. Worth confirming the default suits production throughput.

Severity: HIGH.

The flag is registered as a float64 in go-libs, but it was read with
GetInt, which fails on a float64 flag and returns 0. The worker option was
therefore always 0 (Temporal default = unlimited), so the operator-set
limit never took effect.

Read it with GetFloat64, and wire it to MaxConcurrentActivityExecutionSize
(activity concurrency) rather than TaskQueueActivitiesPerSecond (a
queue-wide rate limit), which is what "max parallel activities" means.

Behavioural note: the default (10) now actually caps activity concurrency
where it previously had no effect.
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@flemzord, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 51 minutes and 52 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 105577c5-1859-42fe-8e9a-7ff6f1ca73ab

📥 Commits

Reviewing files that changed from the base of the PR and between 271bf8d and af56aa0.

📒 Files selected for processing (1)
  • cmd/worker.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/temporal-max-parallel-activities-flag

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@flemzord

flemzord commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

Tracked in Jira: EN-1228 (Epic EN-1217).

@flemzord flemzord changed the title fix(worker): honour temporal-max-parallel-activities flag fix(worker): honour temporal-max-parallel-activities flag (EN-1228) Jun 11, 2026
@flemzord

flemzord commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Superseded by #199, which consolidates this change with the related reliability and safety fixes on top of the current main branch.

@flemzord flemzord closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant