#25432: Django ORM race condition
-------------------------------------+-------------------------------------
Reporter: yuvadm | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by yuvadm):
Replying to [comment:8 shaib]:
> Can you elaborate on that a little? In particular, is the test case
using Django's test-client for these calls? If it is, there's one thread
on the server doing everything, and it all happens in the same
transaction; I'd ask you to check again about caching and replication and
that sort of thing.
This isn't Django test client, I'm calling from any external process
(specifically I'm testing with curl from command line).
> If it isn't the test-client (or even the Django test framework), I'd ask
you to verify again that the second request is only sent after full
processing of the first request has completed.
Yep, I'm using {{{curl http://example.com/foo && curl
http://example.com/foo}}}
> Either way, please also verify that your PostgreSQL configuration is
sane. I've seen recommendations to make testing faster by turning off its
fsync etc, and that could be the cause of such behavior.
This is happening on Heroku Postgres. Any recommendations on how to tinker
with the config there? Is it known to be problematic?
> On a side note: I'm pretty sure get_or_create ''only'' works reliably
under serializable transactions; under the default (read-committed)
isolation level there are failure scenarios, whether you try to get first
or create first.
--
Ticket URL: <https://code.djangoproject.com/ticket/25432#comment:9>
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/064.14311a260c4e2ba2610f1b2e2634f250%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.