-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: django
Context
django-tasks-db is the ORM-backed backend for Django Tasks, the queue that ships with Django 6.0. We have two approaches. Should we leverage a third-party backend for Django Tasks, or should we work directly with the callback hooks and make our own implementations?
A spike resolved claiming by adding an override point to DatabaseBackend in django-tasks-db, with the MongoDB implementation subclassing it from django-mongodb-extensions. It leaves django-tasks-db free of MongoDB-specific code, claims each task exactly once under contention, and leaves SQLite unchanged at 97 passing tests with its original 16 skips. The prototype, the reproductions and a draft upstream issue are in this gist.
Someone needs to also re-spike this ticket to investigate using it without the third party library
Definition of done
- Agree whether to leverage the third party extension or manage the implementation ourselves in django-mongodb-extensions.
Pitfalls
- Maintainer could decline, requiring us to push forward with our own solution.
- Don't branch on has_select_for_update. SQLite reports False too and relies on BEGIN EXCLUSIVE, so keying on that flag routes SQLite down the wrong path.
- migrate crashes on MongoDB until
INTPYTHON-1082lands, or until django-mongodb-extensions carries the interim index patch from the gist.
- is blocked by
-
INTPYTHON-1082 [Django] Indexes declared with ordering expressions are dropped or crash migrate
-
- Closed
-