-
Notifications
You must be signed in to change notification settings - Fork 718
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
All workers run job when using sqlite3 data store #959
Comments
Please try the code from |
Thanks for the quick reply. I´ll give it a try! |
For the record, sqlite3 is a pretty bad choice when you need concurrency. But this shouldn't be happening regardless, so I'll try to reproduce the problem locally and investigate. |
For sure. I´ll definitly use postgres in my production environment. But I´ve came across this bug during my testing. :-) Thanks you very much for developing this fantastic lib. |
Hi @agronholm are there already any updates? Thanks |
Sorry, not yet. But rest assured I will look at this before the next release. |
Maybe this might help regarding sqlite and concurrency. :-) |
@agronholm |
There are Probably not relevant to this problem, but there are also |
Yeah, I think this is enough for the start. |
I hope that it is ok, to document the debugging of this issue further here. First test with three workers shows: Sqlite data store:
Same for the postgres data store looks fine. Does that mean, that the sqlite db is "to slow" for this? Means, the write transaction (setting |
Sqlite is supposed to lock the database file for a transaction to prevent concurrent use. Is this not happening? |
You know, how I can check whether this is happening or not? |
You could try to run multiple processes against the same database which increment a value, wait a couple seconds and then decrement it, and then commit the transaction. If the value starts drifting away from 0 and 1, then you know there's a problem. |
Things to check first
I have checked that my issue does not already have a solution in the FAQ
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Version
v4.0.0a5
What happened?
When using sqlite3 as the data store and redis as the event broker and having several workers running, jobs are executed by all workers.
How can we reproduce the bug?
job.py
scheduler.py
worker.py
Here is a screenshot of running two workers and scheduling the job four times.
The text was updated successfully, but these errors were encountered: