Short answer
No. With spooler-processes greater than one, uWSGI does not guarantee global FIFO execution, regardless of spooler-ordered. The ordering flag only orders how each individual worker scans and picks up files from the spooler directory; it does not coordinate across workers. Two workers can each grab a different file at the same time, and a later-queued task can finish (or start) before an earlier one.
What spooler-ordered actually does
Spooler tasks are files in a directory. By default, a spooler worker iterates that directory in whatever order the filesystem returns entries, which is not reliably creation order. Setting spooler-ordered = true makes the worker sort the directory listing (alphabetically, which matches the timestamp-prefixed filenames uWSGI generates) and process entries in that sequence. That is a per-scan, per-worker guarantee. Nothing prevents worker B from claiming file 002 while worker A is still executing file 001, so end-to-end completion order across the pool is undefined.
Configuration for strict FIFO
If strict ordering is a hard requirement, run exactly one spooler worker:
[uwsgi]
spooler = /var/spool/myapp
spooler-ordered = true
spooler-processes = 1
With a single worker, the sorted scan plus sequential execution gives you effective FIFO. The trade-off is throughput: one long-running task blocks everything behind it, and there is no parallelism.
If you need both ordering and parallelism
uWSGI alone cannot provide this. Your options:
- Partition work so that ordering only matters within a partition, and route each partition to its own single-worker spooler directory.
- Enforce ordering in application code (e.g., sequence numbers with a check that the predecessor completed).
- Move the workload to a queue designed for ordered consumption, such as a single-consumer broker queue or a stream with per-key ordering.
Verifying the behavior yourself
Because this rests on documented behavior that could change across uWSGI releases, confirm it on your version:
- Enqueue 5–10 tasks that log their task ID and a timestamp at execution start.
- Run with
spooler-ordered = true and spooler-processes = 2; check whether the logged execution order matches enqueue order. - Repeat with
spooler-processes = 1 and confirm strict ordering.
Enable spooler logging if available in your build to cross-check which worker picked which file.
Uncertainty
This reflects uWSGI behavior as documented through 2024. The spooler is not under heavy active development, but verify against your installed version's changelog before relying on either the per-worker ordering guarantee or its absence across workers.