memcached
memcached copied to clipboard
memcached.end() not works
In first console:
var memc = new Memcached("127.0.0.1:11211");
memc.add("foo", "bar", 10000, function(err, data){console.log(data)});
memc.get("foo", function(err, data){console.log(data)});
Second console:
var memc = new Memcached("127.0.0.1:11211");
memc.get("foo", function(err, data){console.log(data)});
And now in first console:
memc.end();
memc.get("foo", function(err, data){console.log(data)}); // it works, but expected memc is closed after .end()
And in second console:
memc.end();
memc.get("foo", function(err, data){console.log(data)}); // it works too
Documentation says it close ALL active connectkions:
memcached.end Closes all active memcached connections.
I meet the same question!
Did any 1 of you have resolved this? I tried changing the code to experiment different end/release method to remove connection. Like in memcahced.end method added
manager.end();//pool
manager.release();//pool
memcached.connections[key].end(true);//replace free with end with hard set to true to force destroy connection
But all of them fails...
Any 1 has any update or solution/alternate to this issue. It is(may be) causing serious issue when there traffic on server is coming with 8k qps.
I meet the same question too!
Same here - tested with NodeJS 8.x and 10.x
Still having this issue with Node.js 14 LTS. Decided to use memjs instead, it also supports promises.