Nodejs error: uncaughtException: connection timeout. Occurs renadomly
<p>I am using nodejs version 4.2.0, mongoose 4.4.7, mongodb 3.2.9(I am using mlab). The application runs on docker image. I am getting this error randomly. Due to this error, The server crashes and don not recover until I restart it. Appreciate some guidance on this. Thanks in advance.</p>

<pre><code>2016-10-01T05:09:22.915Z - error: uncaughtException: connection timeout date=Sat Oct 01 2016 05:09:22 GMT+0000 (UTC), pid=60, uid=0, gid=0, cwd=/usr/src/app, execPath=/usr/local/bin/node, version=v4.4.7, argv=[/usr/local/bin/node, /usr/src/app/index.js], rss=69316608, heapTotal=44601440, heapUsed=33179840, loadavg=[0.07080078125, 0.19287109375, 0.13037109375], uptime=21152513, trace=[column=17, file=/usr/src/app/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js, function=, line=168, method=null, native=false, column=13, file=events.js, function=emitTwo, line=87, method=null, native=false, column=7, file=events.js, function=emit, line=172, method=null, native=false, column=14, file=/usr/src/app/node_modules/mongoose/node_modules/mongodb/lib/db.js, function=listener, line=1791, method=null, native=false, column=13, file=events.js, function=emitOne, line=77, method=null, native=false, column=7, file=events.js, function=emit, line=169, method=null, native=false, column=14, file=/usr/src/app/node_modules/mongoose/node_modules/mongodb/lib/server.js, function=, line=270, method=null, native=false, column=16, file=events.js, function=g, line=260, method=null, native=false, column=13, file=events.js, function=emitOne, line=77, method=null, native=false, column=7, file=events.js, function=emit, line=169, method=null, native=false, column=12, file=/usr/src/app/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js, function=, line=322, method=null, native=false, column=13, file=events.js, function=emitOne, line=77, method=null, native=false, column=7, file=events.js, function=emit, line=169, method=null, native=false, column=12, file=/usr/src/app/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js, function=, line=260, method=null, native=false, column=16, file=events.js, function=g, line=260, method=null, native=false, column=13, file=events.js, function=emitTwo, line=87, method=null, native=false, column=7, file=events.js, function=emit, line=172, method=null, native=false], stack=[Error: connection timeout, at null.&lt;anonymous&gt; (/usr/src/app/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:168:17), at emitTwo (events.js:87:13), at emit (events.js:172:7), at listener (/usr/src/app/node_modules/mongoose/node_modules/mongodb/lib/db.js:1791:14), at emitOne (events.js:77:13), at emit (events.js:169:7), at null.&lt;anonymous&gt; (/usr/src/app/node_modules/mongoose/node_modules/mongodb/lib/server.js:270:14), at g (events.js:260:16), at emitOne (events.js:77:13), at emit (events.js:169:7), at null.&lt;anonymous&gt; (/usr/src/app/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:322:12), at emitOne (events.js:77:13), at emit (events.js:169:7), at null.&lt;anonymous&gt; (/usr/src/app/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:260:12), at g (events.js:260:16), at emitTwo (events.js:87:13), at emit (events.js:172:7)] [nodemon] app crashed - waiting for file changes before starting...
</code></pre>