forked from wooga/eredis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notify all consumers awaiting results upon receiving tcp_closed message
Consumers in the redis_client's queue will be sent a `{error, tcp_closed}` message if the connection to redis goes down. Since the queue is reset as part of reconnect, this avoids consumers waiting for a response they will never receive and hitting the gen_server:call timeout. This patch includes a small adjustment to the handle_info callback for receiving TCP data in order to allow test code to fake a TCP closed message. The fake close is achieved by sending a raw {tcp_closed, fake_socket} message to redis_client. Since the unit tests use a real connection to redis which will not have been closed, we have to be able to handle additional data being received on the socket while redis_client is in the process of handling the close and reconnect.
- Loading branch information
Seth Falcon
committed
Jun 15, 2013
1 parent
4bcddfd
commit af2ce0a
Showing
3 changed files
with
94 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters