New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition while reconnecting. #92
Comments
I see this issue pop up when trying to connect to Redis version edit: this turned out to be a different networking issue on my server running Redis |
Oh, thats interesting. I'll try to have a look soon. Sorry for the delay in
responding!
…On Sat, 11 Feb 2017 at 16:51, Josh Austin ***@***.***> wrote:
I see this issue pop up when trying to connect to Redis version 3.0.6,
but do not see it when connecting to Redis version 2.8.4.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#92 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAWPxFn1AH4YGDKZpfVbs0PmL0ctzs1kks5rbecTgaJpZM4KuC1N>
.
|
How is this different than any other socket failure?
do_request(Req, From, State) returns an error when the socket is closed. The client can handle the error and retry. Isn't it enough? Maybe we should handle the connection_ready message when the socket isn't undefined in the state? |
Another option is to check for a live connection on every request and connect otherwise: |
Wouldn't that incur a significant performance penalty?
…On Tue 14. Mar 2017 at 09:41, benbro ***@***.***> wrote:
Another option is to check for a live connection on every request and
connect otherwise:
https://github.com/interline/epgsql_pool/blob/master/src/epgsql_pool_worker.erl
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#92 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAWPxDbLjTsYdc7PuOONBRjJ7HOIcycdks5rlsMkgaJpZM4KuC1N>
.
|
I've discovered race condition while testing reconnection logic. Here below is setup I'm using:
eredis:start_link
and do basic put/get test. I'm using default database, and no authentication
eredis_client
state.When connection dies and socket receives tcp_closed message
eredis_client:reconnect_loop
is called in a separate process where it:There are the following issues with described approach:
reconnect_loop
is executed) receivestcp_closed
message what causes eredis client process using dead socketconnection_ready
message while socket is undefined what causes process termination onunhandled_message
The text was updated successfully, but these errors were encountered: