-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Fully Compatible
-
ALL
-
Service Arch 2021-11-15, Service Arch 2021-11-22
-
149
-
2
In disconnect_kills_cursors.js, we open a load-balanced client to mongos and open a cursor on that client. We then disconnect that client to ensure that mongos kills the open cursor. We verify the cursor is killed by running a $currentOp aggregation here: https://github.com/mongodb/mongo/blob/cca75006b85690faa641a15dfc9940d2a2add52d/jstests/sharding/load_balancer_support/disconnect_kills_cursors.js#L87-L96 looking for the appropriate cursorId.
However, it's possible we run this aggregation before the server-side thread that was managing the disconnected client finishes killing the cursor. We should check that the cursor is closed eventually (in an assert.soon) instead of immediately, to give the server-side thread time to cleanup the cursor.