Skip to content

Correct Priority and Fairness design patterns - #5276

Open
jpvotta wants to merge 26 commits into
mainfrom
docs/fix-fairness-dispatch-semantics
Open

Correct Priority and Fairness design patterns#5276
jpvotta wants to merge 26 commits into
mainfrom
docs/fix-fairness-dispatch-semantics

Conversation

@jpvotta

@jpvotta jpvotta commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Correct the Priority and Fairness design patterns to match Temporal's dispatch behavior. Priority orders backlogged Tasks, and Fairness distributes dispatches across Fairness keys. Neither feature allocates Worker capacity or preempts running Tasks.
  • Keep the original use-case framing while correcting inaccurate terminology, diagrams, comparisons, and limitations.
  • Link to the Task Queue Priority and Fairness guide for setup and SDK examples instead of duplicating them.
  • Rename the Priority Task Queues page and related references to Priority.

Why

The pattern pages described execution and Worker-capacity guarantees that the Matching Service does not provide. These changes align the design guidance with the development guide and server behavior while keeping implementation details in the canonical guide.

@jpvotta
jpvotta requested a review from a team as a code owner September 9, 2026 00:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T00:24:44.316772Z 049f04b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
temporal-documentation Ready Ready Preview Sep 9, 2026 3:59am UTC

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 049f04be53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/best-practices/multi-tenant-patterns.mdx Outdated
Comment thread src/components/elements/PriorityFairnessWalkthrough/HowItWorks.js Outdated

Copilot AI left a comment

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.

🟡 Changes recommended

Linked canonical and related guides still contain the inaccurate execution-order and Worker-capacity claims this PR corrects.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Corrects Priority and Fairness patterns to describe Task dispatch rather than Worker-capacity guarantees.

Changes:

  • Clarifies dispatch behavior, limitations, and comparisons.
  • Replaces duplicated examples with canonical guide links.
  • Renames “Priority Task Queues” to “Priority.”
File summaries
File Description
docs/design-patterns/qos-throughput-patterns.mdx Updates pattern summaries and terminology.
docs/design-patterns/priority-task-queues.mdx Corrects Priority behavior and simplifies implementation guidance.
docs/design-patterns/index.mdx Updates pattern cards.
docs/design-patterns/fairness.mdx Corrects Fairness semantics, diagrams, and limitations.
docs/design-patterns/downstream-rate-limiting.mdx Corrects related-pattern descriptions.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +13 to +15
The Fairness pattern distributes Task dispatches proportionally across tenants or user groups within a shared Task Queue so that a burst from one caller cannot starve others. Each group has a Fairness key and an optional weight. The Matching Service uses weighted fair dispatch to select the next Task within a Priority level.

Fairness applies only to Task dispatch. It does not account for Task duration or resource use.
The Priority Task Queues pattern assigns a `PriorityKey` to Workflows, Activities, and Child Workflows so that time-sensitive work executes ahead of lower-priority work within a single Task Queue—without requiring separate queues or routing logic.
The Priority pattern assigns a Priority key to Workflows, Activities, and Child Workflows so that time-sensitive work dispatches ahead of lower-priority work within a single Task Queue, without requiring separate queues or routing logic.

Priority applies to dispatch. It does not preempt running Tasks or reserve Worker capacity.
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