[CDRIVER-805] Lost notification in mongoc_topology_request_scan Created: 13/Aug/15 Updated: 19/Oct/16 Resolved: 14/Aug/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.2-beta0 |
| Fix Version/s: | 1.2-beta1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
In pooled mode, while the background thread is scanning topology->scanning is true. If the scan is finishing while an application thread requests a scan, that means the current scan hasn't found a suitable server for the application operation and probably won't. The scan should repeat ASAP (after minHeartbeatFrequencyMS), but instead the request is lost and the background thread sleeps the full heartbeatFrequencyMS (default 10 seconds). The code is effectively:
The lost notification happens if topology->scanning is about to be set false and mongoc_topology_request_scan checks it. The scan should recur ASAP, but waits 10 seconds instead. The solution is to not check if topology-scanning in mongoc_topology_request_scan. Instead, always signal the condition. |
| Comments |
| Comment by Githook User [ 14/Aug/15 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: In pooled mode, while the background thread is scanning, topology->scanning is The code is effectively: unlock (mutex); void background_scanner () { } The lost notification happens if topology->scanning is about to be set false The solution is to not check if topology-scanning in |