-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
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
-
None
-
None
-
None
-
None
-
None
-
None
-
None
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)