[CDRIVER-1439] Deal with spurious wakeups from pthread_cond_wait Created: 01/Aug/16 Updated: 19/Oct/16 Resolved: 05/Aug/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.5.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ian Boros | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
From the manpage of pthread_cond_wait(): {block}When using condition variables there is always a Boolean predicate involving shared variables associated with each condition wait that is true if the thread should proceed. Spurious wakeups from the pthread_cond_timedwait() or pthread_cond_wait() functions may occur. Since the return from pthread_cond_timedwait() or pthread_cond_wait() does not imply anything about the value of this predicate, the predicate should be re-evaluated upon such return.{block} Basically, pthread_cond_wait can return whenever it feels like! Our code in the mock server (and maybe elsewhere) doesn't deal with this case, and it should. |
| Comments |
| Comment by Githook User [ 05/Aug/16 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Not a verified bug, but for correctness, re-check the condition after |
| Comment by A. Jesse Jiryu Davis [ 01/Aug/16 ] |
|
Possible cause of |