mongodb-core
Advanced tools
Comparing version 1.2.21 to 1.2.22
@@ -0,1 +1,6 @@ | ||
1.2.22 11-16-2015 | ||
----------------- | ||
- Fixes to handle getMore command errors for MongoDB 3.2 | ||
- Allows the process to properly close upon a Db.close() call on the replica set by shutting down the haTimer and closing arbiter connections. | ||
1.2.21 11-07-2015 | ||
@@ -2,0 +7,0 @@ ----------------- |
@@ -699,4 +699,6 @@ "use strict"; | ||
if(self.cursorState.documents.length == 0 | ||
&& Long.ZERO.equals(self.cursorState.cursorId)) { | ||
&& Long.ZERO.equals(self.cursorState.cursorId) && !self.cmd.tailable) { | ||
self.cursorState.dead = true; | ||
// Finished iterating over the cursor | ||
return setCursorDeadAndNotified(self, callback); | ||
} | ||
@@ -703,0 +705,0 @@ |
@@ -179,7 +179,2 @@ "use strict"; | ||
// console.log("####################################### servers :: " + servers.length) | ||
// servers.forEach(function(x) { | ||
// console.log(x.name) | ||
// }) | ||
// Do we have a custom readPreference strategy, use it | ||
@@ -186,0 +181,0 @@ if(this.s.readPreferenceStrategies != null && this.s.readPreferenceStrategies[readPreference] != null) { |
@@ -161,2 +161,5 @@ "use strict"; | ||
}); | ||
this.arbiters.forEach(function(s) { | ||
s.destroy(); | ||
}); | ||
} | ||
@@ -163,0 +166,0 @@ |
@@ -170,2 +170,4 @@ "use strict"; | ||
, minHeartbeatFrequencyMS: 500 | ||
// stores high availability timer to allow efficient destroy | ||
, haTimer : null | ||
} | ||
@@ -617,3 +619,3 @@ | ||
// Start replicaset inquiry process | ||
setTimeout(replicasetInquirer(this, this.s, false), this.s.haInterval); | ||
setHaTimer(self, self.s); | ||
// Additional options | ||
@@ -726,2 +728,4 @@ if(_options) for(var name in _options) this.s.options[name] = _options[name]; | ||
}); | ||
clearTimeout(self.s.haTimer); | ||
} | ||
@@ -904,2 +908,8 @@ | ||
var setHaTimer = function(self, state) { | ||
// all haTimers are set to to repeat, so we pass norepeat false | ||
self.s.haTimer = setTimeout(replicasetInquirer(self, state, false), state.haInterval); | ||
return self.s.haTimer; | ||
} | ||
var replicasetInquirer = function(self, state, norepeat) { | ||
@@ -969,3 +979,3 @@ return function() { | ||
// Restart ha process | ||
if(!norepeat) setTimeout(replicasetInquirer(self, state, false), state.haInterval); | ||
if(!norepeat) setHaTimer(self, state); | ||
return; | ||
@@ -999,8 +1009,12 @@ } | ||
clearTimeout(timeoutId); | ||
// If the state was destroyed | ||
if(state.replState.state == DESTROYED) return; | ||
// Count down the number of servers left | ||
serversLeft = serversLeft - 1; | ||
// If we have an error but still outstanding server request return | ||
if(err && serversLeft > 0) return; | ||
// We had an error and have no more servers to inspect, schedule a new check | ||
@@ -1012,3 +1026,3 @@ if(err && serversLeft == 0) { | ||
// Return the replicasetInquirer | ||
if(!norepeat) setTimeout(replicasetInquirer(self, state, false), state.haInterval); | ||
if(!norepeat) setHaTimer(self, state); | ||
return; | ||
@@ -1027,4 +1041,9 @@ } | ||
// Add any new servers | ||
if(err == null && ismaster.ismaster && Array.isArray(ismaster.hosts)) { | ||
// | ||
// Process hosts list from ismaster under two conditions | ||
// 1. Ismaster result is from primary | ||
// 2. There is no primary and the ismaster result is from a non-primary | ||
if(err == null | ||
&& (ismaster.ismaster || (!state.primary)) | ||
&& Array.isArray(ismaster.hosts)) { | ||
// Hosts to process | ||
@@ -1055,3 +1074,3 @@ var hosts = ismaster.hosts; | ||
// Let's keep monitoring | ||
if(!norepeat) setTimeout(replicasetInquirer(self, state, false), state.haInterval); | ||
if(!norepeat) setHaTimer(self, state); | ||
return; | ||
@@ -1080,3 +1099,3 @@ } | ||
// Let's keep monitoring | ||
if(!norepeat) setTimeout(replicasetInquirer(self, state, false), state.haInterval); | ||
if(!norepeat) setHaTimer(self, state); | ||
return; | ||
@@ -1083,0 +1102,0 @@ } |
@@ -177,2 +177,7 @@ "use strict"; | ||
// We have an error detected | ||
if(r.documents[0].ok == 0) { | ||
return callback(MongoError.create(r.documents[0])); | ||
} | ||
// Raw, return all the extracted documents | ||
@@ -179,0 +184,0 @@ if(raw) { |
{ | ||
"name": "mongodb-core", | ||
"version": "1.2.21", | ||
"version": "1.2.22", | ||
"description": "Core MongoDB driver functionality, no bells and whistles and meant for integration not end applications", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
440694
8906