adrienmo / eredis_cluster

eredis_cluster is an erlang wrapper for eredis to support cluster mode of redis 3.0.0+
MIT License
79 stars 83 forks source link

Error in call to query when pool is full #28

Open jmendezm opened 5 years ago

jmendezm commented 5 years ago

Avoid error in function eredis_cluster_pool_worker:query() when poolboy return full instead of a Worker PID because pool is full

zuiderkwast commented 4 years ago

Actually, poolboy:transaction/2 is using poolboy:checkout/3 with Block = true. This means that the atom 'full' is not returned. Thus, I think this PR can be closed.

Instead, if the pool is full, the call to poolboy:transaction/2 is blocking. When it times out, it causes an exit:{timeout, {gen_server, call, _}} exception which is converted to {error, no_connection} by the try-catch in eredis_cluster_pool. This causes a refresh mappings and then a retry. The refresh mappings is unnecessary in this case. We have a fix for that here: https://github.com/Nordix/eredis_cluster/pull/27.