Skip to content

Check that all tasks have been processed instead of for empty queue #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

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

alanag13
Copy link
Contributor

reported here: https://code42sw.slack.com/archives/CSEU27LCA/p1592938645114500

Because queues are considered empty as soon as get is performed to retrieve its last item, it is possible for a queue to be empty but for some of its tasks to not be completed yet. Using is_empty() during wait() was causing the program to exit early for this reason in many cases. This was most easily demonstrated by using a bulk file that only processed a very small list of records -- the 5 threads would empty the queue very quickly and the program would then terminate before any requests were actually sent.

@alanag13 alanag13 requested review from timabrmsn and antazoey June 23, 2020 20:09
@alanag13 alanag13 changed the title check that all tasks have been processed instead of for empty queue Ccheck that all tasks have been processed instead of for empty queue Jun 23, 2020
@alanag13 alanag13 changed the title Ccheck that all tasks have been processed instead of for empty queue Check that all tasks have been processed instead of for empty queue Jun 23, 2020
Copy link
Contributor

@kiran-chaudhary kiran-chaudhary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alanag13 alanag13 merged commit 8f17a80 into master Jun 24, 2020
@antazoey antazoey deleted the bugfix/fix-worker-wait branch September 2, 2020 19:48
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.

3 participants