Skip to content
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

Log memcached connection issues, handle case of no healthy servers #114

Merged
merged 4 commits into from
Jul 15, 2013

Conversation

ianshward
Copy link
Collaborator

Attempts to fix #16

From what I could tell, the case when it's not possible to connect to any memcached servers is not handled, and this type of issue is not logged. This pull request adds a handler for the error event on the stream, which calls connectionIssue. Additionally, if no healthy servers are available, and error will be returned. If the client implementation comes across this error, it can be handled.

@3rd-Eden is this on the right track?

@3rd-Eden
Copy link
Owner

@ianshward I think you are indeed on the right track here. But I do see that the tests are failing, was that caused by your patch?

Previously, connectionIssue was only called if a response was
received from the memcached service, and the response was a
SERVER_ERROR.  However, if the node client could not connect to
a memcached server at all, this case was not handled. Now, on the
error event on the stream, call connectionIssue.

Additionally, before trying to connect to memcached, first check
whether any healthy servers exist.
@ianshward
Copy link
Collaborator Author

@3rd-Eden yes I'd broken a few tests. I fixed them and at the same time simplified the logic in the change. I also added two tests, one which tests that a healthy server is removed, and the other tests that a request which went to a failed server is rebalanced to the remaining healthy server when redundancy is true.

3rd-Eden added a commit that referenced this pull request Jul 15, 2013
Log memcached connection issues, handle case of no healthy servers
@3rd-Eden 3rd-Eden merged commit 3ce478f into 3rd-Eden:master Jul 15, 2013
@3rd-Eden
Copy link
Owner

Pull request looks good to me, would you be interested in getting push access @ianshward ?

@ianshward
Copy link
Collaborator Author

@3rd-Eden sure re: push access. I will tread carefully. Related, I've found a problem w/ my above pull req., which is that the timeout event will be fired on an idle connection timeout, as well as a timeout trying to connect. Only the latter should trigger a connection issue. I found there's a related pull req here #93 which I'll take a look at. Looks like it may only need tests.

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.

Server never marked as down and never removed
2 participants