Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit indexing to single task a time #20

Open
cypreess opened this issue Aug 19, 2013 · 2 comments
Open

Limit indexing to single task a time #20

cypreess opened this issue Aug 19, 2013 · 2 comments

Comments

@cypreess
Copy link

I would like to use haystack + celery-haystack + xapian-haystack. Unfortunatelly "Because Xapian does not support simultaneous WritableDatabase connections. If this occurs an DatabaseLockError exception will be raised by Xapian."

So I thought about limiting tasks number to only one by time. Didn't see a proper setting for that, because as far as I understand your code, the COMMAND_WORKERS=1 is not the solution for that.

@wengole
Copy link

wengole commented Mar 22, 2015

I am also having this problem. My Celery instance is used by numerous other tasks and therefore has concurrency > 1.

I have numerous other tasks that result in many Django models being created or updated, resulting in many CeleryHaystackSignalHandler tasks being queued, but only one succeeds. The rest get retried with a 300s timeout.

Am I missing something? It seems a major design oversight to assume celery with a concurrency of 1. I understand that there is a limitation of Xapian to only allow one writer to access the database at a time, so maybe either artificially limit the task to one instance at a time, or fundamentally change the way this works by batching up the writes into one or more transactions?

@Natureshadow
Copy link

This will, at least partially, be mitigated in celery-haystack-ng 2.0. This new version really enqueues updates (in the haystack sense) until teardown of the signal processor. In combination with running in a transaction, this results in exactly one task being scheduled for all update operations when the transaction commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants