Skip to content

removing flush_and_error from on_error handler#533

Closed
chrishamant wants to merge 1 commit into
redis:masterfrom
chrishamant:master
Closed

removing flush_and_error from on_error handler#533
chrishamant wants to merge 1 commit into
redis:masterfrom
chrishamant:master

Conversation

@chrishamant

Copy link
Copy Markdown
Contributor

There are few pull requests (#463 , #362 and #280 (maybe more)) which have been around a while which both attempt (in slightly different ways) to allow for persistence of commands in the offline_queue after a connection error. I'm honestly in support of either case - this pull request is yet another way of handling this.

Looking at the code I noticed that 'on_error' will call 'connection_gone' after it returns from emitting the Error (implication being that the user is listening for the error event). The 'connection_gone' method calls 'flush_and_error' also (it was already called in 'on_error' so it is kind of redundant I'm guessing). If the first call to 'flush_and_error' is just removed as done in this pull request - the command_queue and offline_queue will still be around on the client when the 'error' event is fired which gives the user time to buffer up the commands from these queues in any way they see fit while handling the error event (kind of moving the solutions in #463 and #362 into userland). Implication of this means that the top level 'error' event is fired before the individual command errors. I can conjure some hypothetical scenarios where this might be a problem (maybe someone started listening for 'error' only after getting error on command?) - but I don't think it would be an actual problem in practice.

Just an idea...

@chrishamant

Copy link
Copy Markdown
Contributor Author

reading some of the other issues re: 1.0 it seems this offline_queue may be going way of dodo anyway - so this may be moot...

@brycebaril

Copy link
Copy Markdown
Contributor

@chrishamant given all of the people that rely on offline_queue it isn't going away, just being split from this library into a pluggable connection manager. So it definitely still needs to work right wherever it lands.

BridgeAR added a commit that referenced this pull request Sep 16, 2015
Implement redis connection broken mode and more shiny things

Fixes #569
Fixes #587
Fixes #566 
Fixes #586 
Fixes #280 

This includes the fixes as suggested in #671, #615 and #533. Thx a lot to @qdb, @tobek and @chrishamant 

Closes #675, #463, #362, #438 and #724
@BridgeAR

Copy link
Copy Markdown
Contributor

Thx a lot for your work @chrishamant !

@BridgeAR BridgeAR closed this Sep 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants