[SERVER-61397] Race in disconnect_kills_cursors.js Created: 10/Nov/21  Updated: 29/Oct/23  Resolved: 12/Nov/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0

Type: Bug Priority: Major - P3
Reporter: George Wangensteen Assignee: George Wangensteen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2021-11-15, Service Arch 2021-11-22
Participants:
Linked BF Score: 149
Story Points: 2

 Description   

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. 



 Comments   
Comment by Githook User [ 11/Nov/21 ]

Author:

{'name': 'George Wangensteen', 'email': 'george.wangensteen@mongodb.com', 'username': 'gewa24'}

Message: SERVER-61397 Fix race in disconnect_kills_cursors.js
Branch: master
https://github.com/mongodb/mongo/commit/48d760a25017c8c6633caeaf12e34c1176c35aa5

Generated at Thu Feb 08 05:52:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.