-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Fully Compatible
-
ALL
-
Service Arch 2021-11-22
-
148
-
2
In disconnect_kills_cursors.js, we have two client-connections to mongos, one of which is simulated to be load-balanced using the setClientIsFromLoadBalancer failpoint. We disconnect that load-balanced client from the server to ensure particular server behavior (in this case, cursor killing), when load-balanced clients disconnect. We then use the non-load-balanced connection to ensure the cursor opened by the load-balanced client has been killed and disable the failpoint.
However, it's possible for the non-load-balanced connection to disable the failpoint before the load-balanced client has finished disconnecting. If the fail-point is disabled before the client checks if it is from a load-balancer, it will never run the special load-balanced-client behavior we're testing for, because the fail-point is what we use to "spoof" clients into thinking they're load-balanced. We should remove this race by only disabling the failpoint after we've verified the client has fully disconnected by ensuring any behavior we're checking for has already occurred.