Commit e4fc1921 authored by Phillip Kovalev's avatar Phillip Kovalev

classify connection idle timeout as connection issue

parent 6e8d12f0
......@@ -134,6 +134,7 @@ Client.config = {
manager = new Jackpot(this.poolSize);
manager.retries = memcached.retries;
manager.setMaxListeners(0);
manager.factory(function factory() {
var S = Array.isArray(serverTokens)
......@@ -141,6 +142,7 @@ Client.config = {
: new Socket
, Manager = this
, idleTimeout = function() {
memcached.connectionIssue('Connection timeout', S);
Manager.remove(this);
}
, connectTimeout = function() {
......@@ -175,8 +177,10 @@ Client.config = {
, connect: function streamConnect() {
// Reset timeout. Do not count timeout on allocated connection as
// server issue.
this.setTimeout(0, connectTimeout);
this.setTimeout(this.memcached.idle, idleTimeout);
if (this.memcached.idle > 0) {
this.setTimeout(0, connectTimeout);
this.setTimeout(this.memcached.idle, idleTimeout);
}
}
, end: S.end
});
......@@ -373,6 +377,7 @@ Client.config = {
memcached.HashRing.replaceServer(server, this.failOverServers.shift());
} else {
memcached.HashRing.removeServer(server);
memcached.emit('failure', details);
}
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment