connectionTest

This commit is contained in:
Howard Stearns 2016-02-07 16:39:29 -08:00
parent b6472217c4
commit e52b910e53
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
(function () {
// See tests/performance/tribbles.js
Script.include("../libraries/virtualBaton.41.js");
Script.include("../libraries/virtualBaton.42.js");
var dimensions, oldColor, entityID,
editRate = 60,
moveRate = 1,

View file

@ -219,7 +219,7 @@ function virtualBatonf(options) {
var response = {proposalNumber: data.number, proposerId: data.proposerId};
if (betterNumber(data, bestProposal)) {
bestProposal = data;
if (accepted.winner) {
if (accepted.winner && connectionTest(accepted.winner)) {
response.number = accepted.number;
response.winner = accepted.winner;
}
@ -330,7 +330,7 @@ function virtualBatonf(options) {
exports.recheckWatchdog = timers.setInterval(function recheck() {
var holder = acceptedId(); // If we're waiting and we notice the holder is gone, ...
if (holder && claimCallback && !electionWatchdog && !connectionTest(holder)) {
accepted.winner = bestPromise.winner = null;
bestPromise.winner = null; // used if the quorum agrees that old winner is not there
propose(); // ... propose an election.
}
}, recheckInterval);