3rd-Eden / memcached

A fully featured Memcached client build on top of Node.js. Build with scaling in mind so it will support Memcached clusters and consistent hashing.
MIT License
1.31k stars 276 forks source link

memcached.end() not works #247

Open breeeew opened 9 years ago

breeeew commented 9 years ago

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.

lushijie commented 7 years ago

I meet the same question!

thevirus20 commented 7 years ago

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.

cleverzhang commented 6 years ago

I meet the same question too!

viamuli commented 5 years ago

Same here - tested with NodeJS 8.x and 10.x

taimoorgit commented 3 years ago

Still having this issue with Node.js 14 LTS. Decided to use memjs instead, it also supports promises.