Skip to content

Commit

Permalink
client notified by tcp_closed
Browse files Browse the repository at this point in the history
  • Loading branch information
irr committed Sep 10, 2010
1 parent 441aa4e commit d4f202f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/erldis_client.erl
Expand Up @@ -476,7 +476,7 @@ handle_info({tcp, Socket, Data}, State) ->
{noreply, NewState}
end;
handle_info({tcp_closed, Socket}, State=#redis{socket=Socket}) ->
{noreply, State#redis{socket=undefined}};
{stop, erldis_client_tcp_host_socket_closed, State#redis{socket=undefined}};

This comment has been minimized.

Copy link
@knutin

knutin Feb 9, 2011

Hi!

We noticed that this change changes the behaviour of the client. In our case, the redis server will disconnect the erldis client because it has been inactive for some time. With this change, the erldis client gen_server will crash hard. With the old version, the client will connect again to the redis server when needed.

We would like to understand the reason behind this change, as there might be something important that we are missing.

Thanks
Knut

This comment has been minimized.

Copy link
@irr

irr Feb 9, 2011

Author Contributor

Hi Knut,

Sorry... it was a mistake... an old test and I forgot to remove it. I am not using this version/fork anymore, so I will remove it.

Thanks,

 Ivan

This comment has been minimized.

Copy link
@cstar

cstar Feb 10, 2011

Owner

Knut, Ivan,

Thanks for the feedback. I needed erldis for a new project and ... went shopping in the erldis forks.
Anyway, I'll rollback the change. I'm using erldis in a supervised pool so that would not change much, but there was the case of those pesky messages in the log.

This comment has been minimized.

Copy link
@cstar

cstar Mar 22, 2011

Owner

I have just committed a949411 reverting to the old behavior.

handle_info(_Info, State) ->
{noreply, State}.

Expand Down
4 changes: 2 additions & 2 deletions src/erldis_sync_client.erl
Expand Up @@ -304,7 +304,7 @@ handle_info({tcp, Socket, Data}, State) ->
end;
handle_info({tcp_closed, Socket}, State=#redis{socket=Socket}) ->
error_logger:warning_report([{erldis_sync_client, tcp_closed}, State]),
{noreply, State#redis{socket=undefined}};
{stop, erldis_sync_client_tcp_host_socket_closed, State#redis{socket=undefined}};
handle_info(_Info, State) ->
{noreply, State}.

Expand All @@ -322,4 +322,4 @@ terminate(_Reason, State) ->
Socket -> gen_tcp:close(Socket)
end.

code_change(_OldVsn, State, _Extra) -> {ok, State}.
code_change(_OldVsn, State, _Extra) -> {ok, State}.

0 comments on commit d4f202f

Please sign in to comment.