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

query block #30

Open hchw opened 5 years ago

hchw commented 5 years ago

i found query would blocking, when one slot or node crash , because you refresh slots map synchronous how about let refresh asynchronous and let query return fail immediately?

hchw commented 5 years ago

i try to make refresh be a event , and deal it in a event process, and cast the result to monitor. do you have some advice for me?Or do you agree with me? i will make PR when it stable

clanchun commented 5 years ago

i found query would blocking, when one slot or node crash , because you refresh slots map synchronous how about let refresh asynchronous and let query return fail immediately?

hello, that's exactly what I'm doing in our use case, also I found the retry https://github.com/adrienmo/eredis_cluster/blob/master/src/eredis_cluster.erl#L178 may be too many, I set it to 2.

hchw commented 5 years ago

thank you for your reply. i try to make refresh be a event , cast the event to a new event process to deal the refresh map, and send the result to monitor's state. how about this idea?

clanchun commented 5 years ago

thank you for your reply. i try to make refresh be a event , cast the event to a new event process to deal the refresh map, and send the result to monitor's state. how about this idea?

almost the same with my modification, just to be clear, I'm not the maintainer of this repo, I just modified it a bit and is still testing