Repository navigation
Conversation
auvipy
left a comment
There was a problem hiding this comment.
please make sure that the test passes and the CI REMAIN GREEN
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9713 +/- ##
==========================================
+ Coverage 88.33% 88.34% +0.01%
==========================================
Files 153 153
Lines 19761 19778 +17
Branches 2291 2293 +2
==========================================
+ Hits 17456 17473 +17
Misses 2007 2007
Partials 298 298
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
can you please also try using ulid to check if it works as well? |
|
The checks are failing at |
Flaky. Passed after restart. |
e3c4ee3 to
27f4de5
Compare
Nusnus
left a comment
There was a problem hiding this comment.
Example file (examples/app/myapp.py) is temporarily updated to test generation of custom task_id.
I was just about to ask if you want to add a new example showing how to use it, and/or documentation.
Thank you!
|
Yes it will be helpful to add docs... may be in configuration docs... should I add it here in task config or somewhere else let me know...? |
Sounds good, yeah - thank you! Will it be possible to add an example as well? 🙏 |
| parent = have_parent = None | ||
| amqp = self.amqp | ||
| task_id = task_id or uuid() | ||
| if task_id is None: |
There was a problem hiding this comment.
We need to add tests to make sure it works with all canvas primitives.
E.g, setting task_id_generator once and ensuring all primitives are using it, and another test with a canvas workflow, ensuring as well the generator is used as expected.
I’m not sure this (send_task) is enough to cover all cases
There was a problem hiding this comment.
I have extended task_id_generator to canvas primitives (group, chain, chord, Signature.freeze), for this i have added _new_task_id helper in canvas.py. Have also added tests covering this, @Nusnus let me know what you think.
I’ve also added the config docs with a ULID example. Is that enough, or is a more detailed explanation needed?
Nusnus
left a comment
There was a problem hiding this comment.
Sorry to push back at this phase, but this is a sensitive change that requires more testing. An example will also be useful to let me QA different scenarios manually, but it’s not mandatory for the PR to be merged.
Thank you 🙏
|
this and uuid7(I have open pr for that) support in kombu should be postponed for a while for 5.7. |
|
We have a concrete use case for this feature: UUIDv7 task IDs in a Django/Celery API with database-backed job tracking and recurring Beat jobs. I checked PR #9713 at head With AI assistance, I prepared a small follow-up that reuses the existing Would a contribution against #9713’s branch be useful? I can open a focused PR to the author’s fork or share the patch, whichever you prefer. |
you can open a new PR based on the work from this PRs authors branch, and fix the conflicts, also I have an open PR on kombu which is related to this, I want to merge it early next month before releasing some celery v5.7.x bug fix releases |
Fixes Issue and Discussion: #9662
Description
Changes:
property to theSettings` class, allows users to configure a custom function for generating task_idsend_taskmethod to use the custom generator with fallback to UUID when not specified or when error occurExample file
(examples/app/myapp.py)is temporarily updated to test generation of custom task_id.About TaskID Generation
When implementing a custom
task_idusingtask_id_generator, ensure it return globally unique values across all workers and processes; be aware of clock-related issues like clock drift, system time change if using timestamps; the generator must be fast and avoid blocking operations and consider lexicographic ordering for time-based IDs to help with ordering.Common alternatives of UUID could be ULIDs, Snowflake IDs, or custom prefixed UUIDs for application-specific identification.