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

fix: lock rows and skip them during concurrent poll #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thevaibhav-dixit
Copy link

Fixes #51

@Diggsey
Copy link
Owner

Diggsey commented Mar 18, 2024

Thanks for the PR! I think this kind of change should be accompanied by a regression test though.

@bodymindarts
Copy link

bodymindarts commented Mar 18, 2024

Not sure how best to go about reproducing this locally. In the production environment we observed this we spawned ~200 jobs and had 2 workers running to get through the queue. Before this fix we consistently saw duplicate job_ids... now none anymore.

Do you have a tip on how you would go about testing this?

@Diggsey
Copy link
Owner

Diggsey commented Mar 18, 2024

I would probably spawn a large number of jobs, and then start N threads, and have them all wait on a Barrier to make sure they are properly synchronized, before having them all simultaneously start the job runner.
If the same job is picked up twice, panic.
Rinse and repeat M times, where M is large enough to reliably reproduce the issue.

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

Successfully merging this pull request may close these issues.

Duplicate Spawning of Jobs
3 participants