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

Cursor#close causes crasher when APM enabled

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.26
    • Affects Version/s: 2.2.6, 2.2.25
    • Component/s: None
    • Environment:
      Node: 6.10.0, 4.8.0
      OS: Mac OS X 10.11

      Steps:
      1. Enable the built-in instrumentation with mongodb.instrument(...)
      2. Open and then close a cursor (e.g. using collection.find(...))
      3. Notice error dumped to console.

      Attached is an example reproduction which shows this problem.

      Error:

      /Users/nwolfe/Downloads/experiment/node_modules/mongodb/lib/apm.js:453
                  && this.server.lastIsMaster()
                                ^
      
      TypeError: Cannot read property 'lastIsMaster' of null
          at proto.(anonymous function) [as _killcursor] (/Users/nwolfe/Downloads/experiment/node_modules/mongodb/lib/apm.js:453:27)
          at Cursor.kill (/Users/nwolfe/Downloads/experiment/node_modules/mongodb-core/lib/cursor.js:411:8)
          at Cursor.close (/Users/nwolfe/Downloads/experiment/node_modules/mongodb/lib/cursor.js:973:8)
          at /Users/nwolfe/Downloads/experiment/index.js:28:16
          at /Users/nwolfe/Downloads/experiment/node_modules/mongodb/lib/cursor.js:958:7
          at /Users/nwolfe/Downloads/experiment/node_modules/mongodb/lib/apm.js:233:9
          at /Users/nwolfe/Downloads/experiment/node_modules/mongodb-core/lib/connection/pool.js:461:18
          at nextTickCallbackWith0Args (node.js:489:9)
          at process._tickCallback (node.js:418:13)
      

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            nwolfe Natalie Wolfe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: