Skip to content

Clarify Priority and Fairness dispatch order and add weight override CLI example#4625

Merged
jsundai merged 11 commits into
mainfrom
docs/priority-fairness-tie-break-and-cli
May 28, 2026
Merged

Clarify Priority and Fairness dispatch order and add weight override CLI example#4625
jsundai merged 11 commits into
mainfrom
docs/priority-fairness-tie-break-and-cli

Conversation

@jpvotta

@jpvotta jpvotta commented May 27, 2026

Copy link
Copy Markdown
Contributor

Three changes to docs/develop/task-queue-priority-fairness.mdx:

  1. Dispatch order made explicit. Replaced the "Using Priority and Fairness together" section with "Choosing between Priority, Fairness, and both" - covers when each mode fits and spells out the three-rule dispatch order (priority tier, then fairness weight, then FIFO within a key).

  2. Rate limits section tightened. Removed throat-clearing intro, restructured into bolded "Whole queue rate limits" and "Fairness key rate limits" labels, linked Worker Options to the worker-tuning-reference page.

  3. Weight override CLI example added. The "Fairness weight overrides" section previously said overrides are set "through the config API" without showing how. Added a temporal task-queue config set --fairness-key-weight example.

Motivated by this customer Slack thread asking five clarifying questions about this page.

…CLI example

- Spell out the strict tie-break order (priority -> fairness weight -> FIFO)
  so customers don't have to infer it from scattered sentences.
- Add a "Choosing between Priority, Fairness, and both" subsection covering
  when each mode is the right tool.
- Add a CLI example for setting per-key fairness weight overrides
  (temporal task-queue config set --fairness-key-weight key=weight),
  which was previously only mentioned as "the config API" with no example.
@jpvotta jpvotta requested a review from a team as a code owner May 27, 2026 21:12
@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Building Building Preview, Comment May 28, 2026 7:13pm

Request Review

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links


1. **Priority tier (strict).** Tasks at a higher priority always dispatch before tasks at lower priorities, regardless of fairness keys or weights.
2. **Fairness key within a tier (weighted).** Within a priority tier, each fairness key is a virtual queue. Keys are dispatched proportional to their weights - a key with weight 2.0 is dispatched twice as often as one with weight 1.0.
3. **FIFO within a key.** Tasks that share a priority tier _and_ fairness key dispatch in the order they were enqueued.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We can mention here (or at least in the call) that this is strictly true per partition.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added after rule 3: "These rules apply within a Task Queue partition. See Limitations of Fairness for how partitioning can affect ordering."

Set overrides with `temporal task-queue config set`:

```
temporal task-queue config set \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One small thing! It looks like --namespace might be missing here after task-queue-type activity. I noticed the rate limits example just above includes it. But super easy fix 🙂

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added --namespace my-namespace \ to the weight-overrides snippet to match the rate-limits example above.

@jsundai

jsundai commented May 28, 2026

Copy link
Copy Markdown
Contributor

Once the edits are made, I'll give this a merge!

- Add --namespace to weight overrides CLI example to match the rate
  limits example above.
- Note that the three dispatch rules apply within a Task Queue
  partition, linking to the existing Limitations section.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jsundai jsundai merged commit c478ca2 into main May 28, 2026
9 checks passed
@jsundai jsundai deleted the docs/priority-fairness-tie-break-and-cli branch May 28, 2026 19:15
chaptersix added a commit to temporalio/cli that referenced this pull request May 29, 2026
…1056)

The `temporal task-queue config set` help text referenced three flags
that don't exist:

- `--fairness-key-weight-set <key>=<weight>`
- `--fairness-key-weight-unset <key>`
- `--fairness-key-weight-unset-all`

The real flags, defined a few lines below in the same YAML block, are:

- `--fairness-key-weight <key>=<weight>` (with `<key>=default` to unset
a single key)
- `--fairness-key-weight-clear-all`

This PR updates the example block and the unset instructions in
`commands.yaml` to match, and regenerates `commands.gen.go`. Verified
locally with `go run ./cmd/temporal task-queue config set --help`.

This bug also surfaces in the auto-generated docs site at
[docs/cli/task-queue.mdx](https://docs.temporal.io/cli/task-queue#set),
which a customer hit in [this Slack
thread](https://temporaltechnologies.slack.com/archives/C0748KDH2DD/p1779899719317389?thread_ts=1779898503.202859&cid=C0748KDH2DD).
The docs PR over in `temporalio/documentation#4625` works around it by
referencing the real flag names directly.

Co-authored-by: Alex Stanfield <13949480+chaptersix@users.noreply.github.com>
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