Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4474

ListIndexes cursors do not close cursor properly on ns not found errors

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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!'));

            Assignee:
            Unassigned Unassigned
            Reporter:
            bailey.pearson@mongodb.com Bailey Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: