-
Notifications
You must be signed in to change notification settings - Fork 105
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
Possible race condition? #9
Comments
Are you able to reproduce the issue? A sample code which fails would be helpful. I tested with hundreds of thousands jobs running in parallel (empty jobs to make sure they run and finish at the same time), but the issue never occurred. Every job has a key in Redis, after the job finishes it gets marked in that key. So if A finishes slightly sooner, it doesn't trigger child job since B is running. |
No, it's a completely theoretical question. I'm still wondering what would happen if they finish at precisely the same time. |
If they do finish at precisely the same time, then it is possible. That said, I probably should add some mutex to job enqueuing to make sure they don't get enqueued twice. 👍 Thanks for bringing this up :) |
Closing as this wasn't actually spotted in actual apps using Gush. |
I read the code, and couldn't figure out, how you handle a race condition when job C is dependent on jobs A and B which finish at the same time.
The text was updated successfully, but these errors were encountered: