-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
Our ListIndexesCursor does not properly close itself after receiving namespace not found errors in load balanced mode, resulting in the process hanging.
This doesn't seem to be reproducible for server errors with other cursors. I tested by setting failCommands for getMore and iterating the cursor using Cursor.toArray, but it never hung for aggregate or find.
User Impact
Unsure. Any users who attempt to list indices on a collection that doesn't exist would encounter this bug, but that seems unlikely.
Acceptance Criteria
- Determine the root cause as to why namespace not found errors prevent ListIndexesCursors from closing properly in load balanced mode.
- Fix the bug
Steps to reproduce
The following code snippet produces a hanging process. I tested with a load balanced setup after following the lb environment setup instructions in the driver repo with mongodb 6.0.0.
import { MongoClient } from './src'; async function main() { const client = new MongoClient('mongodb://127.0.0.1:8000/?loadBalanced=true'); await client.connect(); await client.db('test').dropCollection('test'); await client .db('test') .collection('test') .indexes() .catch(e => e); await client.close(); } main().then(() => console.error('done!'));