scholrly / neo4django

Drop-in Neo4j/Django integration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lazy behaviour when parallel requests

pirhoo opened this issue · comments

Hi,

I have a curious behaviour that I still can't explain after 2 days of investigation. When I execute several queries with neo4django at the same time (or very close), the process gets lazy and the request never ends (probably because the previous one is not done).

I got this bug with neo4j 1.8.2 and 1.9.1, and Django 1.4.4 and 1.5.4. I can't give more detail because the only way to provoke this bug is to madly refresh a page.

Thanks for the amazing work,
Pierre

Hm, there is some transactional logic related to the in-graph type tree- maybe that's involved? What sort of requests are they, read or write?

Mainly read and without any particular conditions: I succeed to reproduce this bug with a simple User.objects.all() (among 20 nodes).

Hm, that's no good. Is it using the dev server or in production? If it were reproducible using, say, the requests library and threads, that'd be easier to test & fix.

Interesting: it seems that the bug doesn't happen in production (on heroku).

Aha! Good, I was worried. It might be because the Django dev server is
threaded, while production is usually process-based. To test that I believe
there's a '--nothreading' (or similarly named) argument to runserver.
Maybe give that a shot? Regardless this sounds like a bug, but we'll see
whether it's a big or little one.
On Oct 25, 2013 5:56 PM, "Pierre Romera" notifications@github.com wrote:

Interesting: it seems that the bug doesn't happen in production (on
heroku).


Reply to this email directly or view it on GitHubhttps://github.com//issues/223#issuecomment-27129143
.

OK, that sounds reassuring. I'm trying what you propose.

Hmm, and threading would worsen performance?
Il 26/ott/2013 00:07 "Pierre Romera" notifications@github.com ha scritto:

OK, that sounds reassuring. I'm trying what you propose.


Reply to this email directly or view it on GitHubhttps://github.com//issues/223#issuecomment-27129742
.

Ha! Good news: the --nothreading option fix it, thanks!

I don't think we can consider this issue as solved so I let you decide if we should close it.

No, I'll leave it open. It's going to be fun to debug :)
On Oct 25, 2013 6:19 PM, "Pierre Romera" notifications@github.com wrote:

Ha! Good news: the --nothreadinghttps://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-option---nothreadingoption fix it, thanks!

I don't think we can consider this issue as solved so I let you decide if
we should close it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/223#issuecomment-27130367
.

OK, you're the boss. Thanks again, you saved my weekend!