-
Type:
Task
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: MongoDB 3.2
I have this sample application running with a replica set:
'use strict';
const MongoClient = require('mongodb').MongoClient; return MongoClient.connect('mongodb://ip1:port1,ip2:port2,ip3:port3/dbName?replicaSet=testSet', function(err, db) { if (err) { return console.error('Err:', err); } setInterval(function() { console.log('Interval'); return db.collection('tests').count({}, function(err, count) { if (err) { console.error('Err:', err); } else { console.log('Count:', count); } }); }, 2000); }); {
When I block all the outgoing/incoming connections with a firewall, the Mongo client keeps all the pending outgoing requests in a buffer. Then, when I unblock the connections, nothing happens. It seems the client does not reconnect and the application stays frozen.
Note: Sometimes there is a reconnection but it's unpredictable.