mongodb-core
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -0,1 +1,5 @@ | ||
1.2.5 07-14-2015 | ||
----------------- | ||
- NODE-492 correctly handle hanging replicaset monitoring connections when server is unavailable due to network partitions or firewalls dropping packets, configureable using the connectionTimeoutMS setting. | ||
1.2.4 07-07-2015 | ||
@@ -2,0 +6,0 @@ ----------------- |
@@ -172,3 +172,2 @@ "use strict"; | ||
this.primary = null; | ||
return 'primary'; | ||
} | ||
@@ -195,4 +194,2 @@ | ||
}); | ||
return 'passive'; | ||
} | ||
@@ -205,3 +202,9 @@ | ||
return 'secondary'; | ||
// Get the isMaster | ||
var isMaster = server.lastIsMaster(); | ||
// Return primary if the server was primary | ||
if(isMaster.ismaster) return 'primary'; | ||
if(isMaster.secondary) return 'secondary'; | ||
if(isMaster.passive) return 'passive'; | ||
return 'arbiter'; | ||
} | ||
@@ -208,0 +211,0 @@ |
@@ -579,3 +579,3 @@ "use strict"; | ||
} | ||
/** | ||
@@ -839,3 +839,3 @@ * Ensure single socket connections to arbiters and hidden servers | ||
s.index = (s.index + 1) % servers.length; | ||
return servers[s.index]; | ||
return servers[s.index]; | ||
} | ||
@@ -857,3 +857,3 @@ } | ||
s.index = (s.index + 1) % servers.length; | ||
return servers[s.index]; | ||
return servers[s.index]; | ||
} | ||
@@ -933,2 +933,11 @@ | ||
// Kill the server connection if it hangs | ||
var timeoutServer = function(_server) { | ||
return setTimeout(function() { | ||
if(_server.isConnected()) { | ||
_server.connections()[0].connection.destroy(); | ||
} | ||
}, self.s.options.connectionTimeout); | ||
} | ||
// | ||
@@ -940,4 +949,9 @@ // Inspect a specific servers ismaster | ||
if(server && server.isConnected()) { | ||
// Get the timeout id | ||
var timeoutId = timeoutServer(server); | ||
// Execute ismaster | ||
server.command('system.$cmd', {ismaster:true}, function(err, r) { | ||
// Clear out the timeoutServer | ||
clearTimeout(timeoutId); | ||
// If the state was destroyed | ||
if(state.replState.state == DESTROYED) return; | ||
@@ -944,0 +958,0 @@ // Count down the number of servers left |
{ | ||
"name": "mongodb-core", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Core MongoDB driver functionality, no bells and whistles and meant for integration not end applications", | ||
@@ -29,3 +29,4 @@ "main": "index.js", | ||
"rimraf": "2.2.6", | ||
"mongodb-version-manager": "^0.7.1" | ||
"mongodb-version-manager": "^0.7.1", | ||
"co": "4.5.4" | ||
}, | ||
@@ -32,0 +33,0 @@ "optionalDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
418942
8459
10