Repository navigation
Rust #325: try poll candidates in published PHP's fairness order - #895
Merged
Merged
Conversation
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 1, 2026
Published PHP tries each batch of a poll's candidates (10 at the default max_tasks_per_poll) in TaskFairnessScheduler order: within a priority tier, fairness classes take turns by weight. Its fairness state starts empty on every request of its Apache server, so the order never moves a poll's first candidate. It decides which candidate a poll tries next when an earlier one can't be claimed. Native now drops unsupported workflow types as PHP's SQL does, and tries its candidates in the same batches and order. There is no shared fixture. The skipped candidate in a recording is a resume task, and published PHP gives resume tasks no fairness key, against its own inheritance contract (workflow#971). Native follows the contract, so that task's class differs between the servers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rmcdaniel
force-pushed
the
rust-325-task-fairness
branch
from
November 1, 2026 03:51
83fa8b1 to
2807d96
Compare
|
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Part of #325.
Contract (published Server 2.11.7, Workflow 2.15.7)
WorkflowTaskPoller::claimReadyTaskandActivityTaskPoller::claimReadyTaskread a batch of candidates: limitmax(10, max_tasks_per_poll * 10), 10 by default. The workflow bridge filters workflow types in SQL, and pages forward until a batch holds an eligible task.TaskFairnessScheduler::reorderorder:InMemoryTaskFairnessState, which starts empty on every request of the Apache image. So only the batch's own picks count, and the first candidate never moves. The order decides which candidate a poll tries next when an earlier one can't be claimed.Evidence. Raw worker HTTP against published 2.11.7, using a worker that can't replay typed search attributes:
a);Change
priority_fairness::fairness_order: the reorder, starting from empty state.Store::fairness_batches: the claim loop drops candidates of an unsupported workflow type, as PHP's SQL does. It splits the rest into batches of 10 and tries each batch in that order.Why no shared fixture
The skipped candidate in a recording is always a resume task, since a first task has no history to be skipped for. Published PHP gives resume tasks, and timer tasks, the default priority and no fairness key. That contradicts its own published inheritance rule (
workflow_task => inherits_priority_and_fairness_from_parent_run), filed as durable-workflow/workflow#971. Native follows the rule, so the two servers place that task in different classes. With the same keys, native reproduced PHP's order.Remaining
These are documented in the checkpoint:
Checks
fairness_orderpins the order: alternation, weights and tiers.a_skipped_candidate_is_followed_by_another_fairness_classpins the claim path: A1 (a, skipped), A2 (a), B1 (b) gives B1, then A2.PhpImageContextTest.Checkpoint.
🤖 Generated with Claude Code