[SERVER-34508] Prevent race condition in Migration Destination Manager from swallowing an exception Created: 16/Apr/18 Updated: 29/Oct/23 Resolved: 18/Apr/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.4.14, 3.6.4, 3.7.3 |
| Fix Version/s: | 3.4.15, 3.6.5, 3.7.6, 4.0.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Blake Oler | Assignee: | Blake Oler |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v3.6, v3.4
|
||||||||||||
| Sprint: | Sharding 2018-04-23 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 54 | ||||||||||||
| Description |
|
A triggerable race condition exists in the Migration Destination Manager's use of the producer-consumer queue. Upon throwing from inside the insert batch function, both of these will happen:
If the main thread is currently fetching another batch from remote, it will try to push the batch to the queue before checking for an operation context interrupt. The queue will throw back its own exception, `ProducerConsumerQueueEndClosed`. The queue's exception will be the exception returned to the client. This results in the wrong error code returned. This can be fixed by adding another checkForInterrupt in between the fetch batch function and the push to the queue, in case this race condition is triggered. |
| Comments |
| Comment by Githook User [ 17/Apr/18 ] |
|
Author: {'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}Message: (cherry-picked from commit a8d13f8329478996e315f390089039f7b7a29ab8) |
| Comment by Githook User [ 17/Apr/18 ] |
|
Author: {'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}Message: (cherry-picked from commit a8d13f8329478996e315f390089039f7b7a29ab8) |
| Comment by Githook User [ 17/Apr/18 ] |
|
Author: {'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}Message: |