Check that all tasks have been processed instead of for empty queue #105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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. Usingis_empty()
duringwait()
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.