christkv/node-mongodb-native — Issue #401: "auto_reconnect: true" db option crashes program when mongodb is gone
Author: yushih
Created: 2011-11-12 08:24:33+00:00
State: open

Thanks for the great module, everything works fine except when I enable "auto_reconnect: true" and kill mongod, which leads to an exception. Here is the code:
https://gist.github.com/1360235
The program inserts a document every 1 sec. If I kill mongod when it is running, I get:

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: connection closed to [127.0.0.1:27017]
at [object Object]. (/home/hys/work/mongo/node_modules/christkv-node-mongodb-native-a402314/lib/mongodb/connection/server.js:184:100)
at [object Object].emit (events.js:70:17)
at [object Object]. (/home/hys/work/mongo/node_modules/christkv-node-mongodb-native-a402314/lib/mongodb/connection/connection_pool.js:110:14)
at [object Object].emit (events.js:70:17)
at Socket. (/home/hys/work/mongo/node_modules/christkv-node-mongodb-native-a402314/lib/mongodb/connection/connection.js:313:12)
at Socket.emit (events.js:67:17)
at Array.0 (net.js:300:10)
at EventEmitter._tickCallback (node.js:192:40)

Is it an issue with the library or my program? Thank you for your time and patience.