Repository navigation
Support custom task ID generation across dispatch and canvas - #11128
Open
qfarizon-qftech wants to merge 14 commits into
Open
qfarizon-qftech wants to merge 14 commits into
qfarizon-qftech wants to merge 14 commits into
Conversation
Co-authored-by: Copilot <[email protected]>
Honor the configured generator during eager execution, preserve IDs across retries and resolve the owning app for canvas IDs. Retain main behavior for empty IDs, parent groups and serialized signatures, and use the generator when chord error handling creates a missing callback ID. Register configuration aliases, document the Kombu default and UUIDv7 usage, and cover all canvas primitives, native retry publications and generator fallback. Full unit suite: 5593 passed, 17 skipped, 2 xfailed, 27675 subtests; pre-commit hooks and real Redis worker workflows passed.
auvipy
self-requested a review
November 18, 2026 08:58
auvipy
reviewed
Nov 18, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11128 +/- ##
===========================================
- Coverage 91.21% 0 -91.22%
===========================================
Files 153 0 -153
Lines 21778 0 -21778
Branches 2701 0 -2701
===========================================
- Hits 19865 0 -19865
+ Misses 1612 0 -1612
+ Partials 301 0 -301
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Member
|
after merging celery/kombu#2303 we will consider this |
auvipy
reviewed
Nov 18, 2026
| .. code-block:: python | ||
|
|
||
| # Using ULID (pip install python-ulid) | ||
| import ulid |
Member
There was a problem hiding this comment.
may be we should also consider ulid support in kombu as well
This branch has not been deployed
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.
Add
task_id_generator, a zero-argument callable whose result is converted to a string for new task and canvas IDs. This supports UUIDv7, ULIDs and application-specific IDs while retaining supplied IDs and native retry identity. With no custom generator, or if it raises, Celery uses Kombu's default UUID generator.This continues @jiisanda's work in #9713, rebased onto current
main, as requested in #9713 (comment). The original commits and their authorship are retained. Prepared with AI assistance and reviewed against the current dispatch, canvas and backend paths.The follow-up completes eager execution (
Task.applyandtask_always_eager), uses the configured generator for missing chord-error callback IDs, resolves generators consistently across configuration styles, and preserves the current behavior for empty IDs, nested groups and app-bound signatures. The configuration documentation includes ULID and Python 3.14 UUIDv7 examples.Tests cover normal and eager execution; signatures, groups, chains, chords, map, starmap, chunks and a composed workflow; repeated freezing; explicit IDs; published retry IDs; missing/failed generators; app selection; and chord-error handling. A real worker/Redis check verifies completed results for one-off, chain, group, chord and retry workflows using UUIDv7, plus preservation of an explicit ID.
The default remains a call to Kombu's UUID generator, with no UUID version hardcoded and no dependency on celery/kombu#2303. That related change can determine the default independently.
Fixes #9662. Continues #9713.
Validation
configcheckreports the same 28 pre-existing undocumented settings on this branch andmain;task_id_generatoris recognized and introduces no additional missing-setting errors.