#27734: Parallel tests try to use database with too high indices
-----------------------------------+--------------------------------------
Reporter: Adam Wróbel | Owner: nobody
Type: Bug | Status: closed
Component: Testing framework | Version: 1.10
Severity: Normal | Resolution: needsinfo
Keywords: parallel | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Comment (by David Breeden):
I'm having this problem. It's not Django's fault, although there could be
better error reporting.
`--parallel` creates N databases for the N workers to use. Each worker
claims the database it will use by incrementing a shared counter. When
the `multiprocessing.Pool` is initialized with N processes, the workers
are assigned databases 1 through N.
The problem happens when a worker exits. Normally, the workers in a pool
will stay alive for the whole life of the pool. In my case, workers are
exiting because of seg faults. When this happens, the pool repopulates
with new workers. When the first new worker is initialized, it increments
the counter to N + 1 and tries to use that database, and this error
results.
Only some of my tests cause the seg fault, so if I run `--parallel` with
other tests, it works fine.
It would have saved some time diagnosing the issue if Django raised an
error when a worker incremented the counter over N, which seems like a
reasonable thing for the initializer to do.
--
Ticket URL: <https://code.djangoproject.com/ticket/27734#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/061.fa553a2c05a8a440a610db1104e3323f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.