Comparing version 2.2.0 to 2.2.1
@@ -506,2 +506,28 @@ /* | ||
Object.defineProperty(CueBallClaimHandle.prototype, 'writable', { | ||
get: function () { | ||
throw (new mod_errors.ClaimHandleMisusedError()); | ||
} | ||
}); | ||
Object.defineProperty(CueBallClaimHandle.prototype, 'readable', { | ||
get: function () { | ||
throw (new mod_errors.ClaimHandleMisusedError()); | ||
} | ||
}); | ||
CueBallClaimHandle.prototype.on = function (evt) { | ||
if (evt === 'readable' || evt === 'close') { | ||
throw (new mod_errors.ClaimHandleMisusedError()); | ||
} | ||
return (EventEmitter.prototype.on.apply(this, arguments)); | ||
}; | ||
CueBallClaimHandle.prototype.once = function (evt) { | ||
if (evt === 'readable' || evt === 'close') { | ||
throw (new mod_errors.ClaimHandleMisusedError()); | ||
} | ||
return (EventEmitter.prototype.once.apply(this, arguments)); | ||
}; | ||
CueBallClaimHandle.prototype.try = function (slot) { | ||
@@ -886,2 +912,7 @@ mod_assert.ok(this.isInState('waiting'), 'ClaimHandle#try may only ' + | ||
ConnectionSlotFSM.prototype.isRunningPing = function () { | ||
return (this.isInState('busy') && this.csf_handle && | ||
this.csf_handle.csf_pinger); | ||
}; | ||
ConnectionSlotFSM.prototype.state_init = function (S) { | ||
@@ -1021,3 +1052,11 @@ S.on(this, 'startAsserted', function () { | ||
'at cueball.doPingCheck\n', | ||
callback: checker, | ||
callback: function pingCheckAdapter(err, hdl, conn) { | ||
/* | ||
* Since we give an infinite timeout and never call | ||
* .fail() on the handle, we should never be called | ||
* with a non-null "err" parameter here. | ||
*/ | ||
mod_assert.strictEqual(err, null); | ||
checker(hdl, conn); | ||
}, | ||
log: fsm.csf_log, | ||
@@ -1027,2 +1066,3 @@ claimTimeout: Infinity | ||
var handle = new CueBallClaimHandle(hdlOpts); | ||
handle.csf_pinger = true; | ||
/* | ||
@@ -1029,0 +1069,0 @@ * Don't bother handling a return to "waiting" state here: if we |
@@ -15,3 +15,4 @@ /* | ||
PoolFailedError: PoolFailedError, | ||
PoolStoppingError: PoolStoppingError | ||
PoolStoppingError: PoolStoppingError, | ||
ClaimHandleMisusedError: ClaimHandleMisusedError | ||
}; | ||
@@ -22,2 +23,12 @@ | ||
function ClaimHandleMisusedError() { | ||
if (Error.captureStackTrace) | ||
Error.captureStackTrace(this, ClaimHandleMisusedError); | ||
this.name = 'ClaimHandleMisusedError'; | ||
this.message = 'CueBall claim handle used as if it was a ' + | ||
'socket. Check the order and number of arguments in ' + | ||
'your claim callbacks.'; | ||
} | ||
mod_util.inherits(ClaimHandleMisusedError, Error); | ||
function ClaimTimeoutError(pool) { | ||
@@ -24,0 +35,0 @@ if (Error.captureStackTrace) |
@@ -650,4 +650,6 @@ /* | ||
*/ | ||
if (newState === 'ping' && !fsm.p_initq_node) | ||
if (newState === 'busy' && fsm.isRunningPing() && | ||
!fsm.p_initq_node) { | ||
fsm.p_initq_node = self.p_initq.push(fsm); | ||
} | ||
@@ -654,0 +656,0 @@ if (newState === 'failed') { |
{ | ||
"name": "cueball", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "manage a pool of connections to a multi-node service where nodes are listed in DNS", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
4
157739
16
4237