Preserve chord body priority when no override is provided by Dcastroro · Pull Request #10886 · celery/celery · GitHub
Skip to content

Preserve chord body priority when no override is provided - #10886

Draft
Dcastroro wants to merge 1 commit into
celery:mainfrom
Dcastroro:fix/chord-priority-none
Draft

Dcastroro wants to merge 1 commit into
celery:mainfrom
Dcastroro:fix/chord-priority-none

Conversation

@Dcastroro

Copy link
Copy Markdown

Description

Fixes #7517.

When a chord follows another task in a chain, the tracer passes priority=None if parent-priority inheritance is disabled. The chord clones its body with that value, erasing the body's configured priority. For example, a body with priority=2 reaches the backend with priority=None.

Dismiss None call options before cloning the chord body, matching Signature.apply_async(). Explicit priorities, including zero and inherited parent priorities, continue to override the stored value. Adds 12 parametrized cases covering direct chord dispatch and the actual task-tracer-to-chord path, plus a changelog entry.

Validation on upstream base 79baa09f2fe08c0aa455b60191b96f6809655282:

  • New cases before the fix: 4 failed, 8 passed. All 12 pass with the fix.
  • pytest t/unit/tasks -q: 1,202 passed, 1 skipped, 1 xfailed, plus 27,629 passing subtests, on both Windows/Python 3.12.13 and Linux/Python 3.12.3.
  • Repository pre-commit checks pass for the changed files, including pyupgrade, flake8, isort, spelling and mypy.
  • Unfiltered Bandit 1.9.4 scans of the base and changed production trees report the same 49 findings, with identical file, code, line, severity and confidence; no new findings. The repository's historical bandit.json cannot be loaded by this Bandit version (issue_cwe is missing). No security configuration or checks were changed.

Tests use the in-memory transport/backend. External broker integration tests and the full Python-version matrix were not run locally.

AI assistance: OpenAI Codex prepared the patch, regression tests and this draft on Dcastroro's behalf. Human review is pending.

Dismiss None execution options before cloning the chord body, matching Signature.apply_async. Covers direct chord dispatch and chained dispatch with priority inheritance enabled or disabled, including zero priority.

This branch has not been deployed

No deployments
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.

Priority is lost on chord body when embedded in chain

1 participant