[SERVER-36453] Fix race condition in aggregation_cursor_invalidations.js Created: 03/Aug/18  Updated: 29/Oct/23  Resolved: 30/Aug/18

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.0.3, 4.1.3

Type: Improvement Priority: Major - P3
Reporter: Ian Boros Assignee: Ian Boros
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Query 2018-08-13, Query 2018-08-27
Participants:
Linked BF Score: 31

 Description   

Modify the test to check whether there are any open cursors using $listLocalCursors rather than db.serverStatus(). This will allow to test whether there are any open cursors on the collection being used, rather than whether there are any open cursors (which may include cursors opened by background jobs and so on).



 Comments   
Comment by Githook User [ 31/Aug/18 ]

Author:

{'name': 'Ian Boros', 'email': 'ian.boros@10gen.com'}

Message: SERVER-36453 robustify aggregation_cursor_invalidations.js

(cherry picked from commit d1db98c28473ec3474e617b2c668a4b61bec9bcd)
Branch: v4.0
https://github.com/mongodb/mongo/commit/5d7dcfd7af1eb48d85cc949586fba84eee4515aa

Comment by Githook User [ 30/Aug/18 ]

Author:

{'name': 'Ian Boros', 'email': 'ian.boros@10gen.com'}

Message: SERVER-36453 robustify aggregation_cursor_invalidations.js
Branch: master
https://github.com/mongodb/mongo/commit/d1db98c28473ec3474e617b2c668a4b61bec9bcd

Comment by Ian Boros [ 20/Aug/18 ]

There's a race condition in the test here. At the time we kill the operation, the server may hit the checkForInterrupt call within here and not check out the cursor. This would mean that the operation completes without destroying the cursor.

Generated at Thu Feb 08 04:43:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.