memcached
memcached copied to clipboard
Calling get() on down server hangs
the simplest way to reproduce this is to simply run: $ node simple_get.js in the ./examples directory
since I dont have a server at 10.211.55.5 the request should fail, instead it hangs I also used memcache-urls ['127.0.0.1:11211', '127.0.0.1:11212'] when running a local memcache, the first url works, the second hangs
i tried it, it throws an error after few minutes for me.
I will eventually timeout, but the default config/setup does not behave as I would expect if server is down.
I agree this is not expected. It will eventually give an ERROR but it takes way to long. In my code i typically have to start a timer event and if i do not get a result in x amount of time I callback(err, null)
Any solution to solve this issue ? I am also facing the same issue. It waits for 100 seconds before throwing error.
Hello, First of all thank you for your great work on this module ! I have exactly the same behavior as monishavictor, it waits for 100 seconds before throwing the error... It would be great to have the possibility to set a timeout shorter than this value. Thanks !
I got the same issue on this situation. (Try connecting to a down server and get nothing but hangs with a thrown error in quite long time)
The connection timeout is handled by the Jackpot dependency. There are separeate options to change the connection timeout behaviour, they can be used in the constructor options argument:
, retries: 5 // Connection pool retries to pull connection from pool
, factor: 3 // Connection pool retry exponential backoff factor
, minTimeout: 1000 // Connection pool retry min delay before retrying
, maxTimeout: 60000 // Connection pool retry max delay before retrying
, randomize: false // Connection pool retry timeout randomization
see: https://github.com/3rd-Eden/memcached/blob/master/lib/memcached.js#L88-L92