adjust queue depth warnings to emit when all threads are busy#243
adjust queue depth warnings to emit when all threads are busy#243digitalresistor merged 7 commits intomasterfrom
Conversation
c831dc9 to 5670065 Compare 6810093 to e02fe79 Compare e02fe79 to c083d0b Compare This avoids looping over the dictionary in `add_task` for the extra complexity of keeping a simple counter of which threads are active or not activate.
Queue depth warnings (using integer inc/dec for active)
| Hi @bertjwregeer and @mmerickel! As the person who contributed the original code for the queue depth warning, would you mind a quick explanation of what issue(s) this PR actually fixes? I don't really understand the diff I'm afraid. Just for my own interest really! Thanks :) |
| The main issue is that it would warn if you submitted several tasks in a row (like a web browser does) and you have available threads to process them, they just haven't switched over to grab them yet. This was causing a lot of false positive warnings. So this change starts tracking the number of idle threads and only warns if all threads are busy. I only just realized while typing this that there is one uncovered case right now where it's possible to submit more tasks than can be handled but no threads are busy and so no warning will be emitted. We should check the queue size and compare it to the number of idle threads. |
| Ah cool, that makes sense. We have actually seen behaviour a bit like that, so hopefully this change will help. Thanks for the explanation! |
No description provided.