DESCRIPTION

Added all memcached error codes to spymemcached

Previously we only checked a subset of the error codes that
memcached can send back to a client. This created an issue because
if a user recieves an error code that it doesn't expect it resets
the connection. This commit adds all error codes.

Change-Id: I9317eccd688b6fa1e7113847cd7c7ef160a6624f


COMMENTS

author: Kenny Maynard
date: 2011-06-15 22:48:06.118000000

Patch Set 1: Verified



-------------------------------------
author: Andreas Short
date: 2011-06-15 23:05:40.892000000

Patch Set 1: I would prefer that you didn't submit this

Generally, this looks okay.  Concern is that we do not test any of this.  I think it should be possible to do so from the test side.  Perhaps mocking a MemcachedNode that responds to every op with one of these.  Have a look at some of the vbucket tests, as they do something similar.

The big concern here is that modifying existing, working code is better done with tests that run both before and after with the same result.

Can you check into adding tests?

-------------------------------------
author: Kenny Maynard
date: 2011-06-16 00:43:04.724000000

Patch Set 1:

I agree that there is a need here for testing, but I disagree on testing that the results before match the results after. Remember when I was doing the Sqoop stuff I had major issues with spy and that was because we didn't include all of the error codes. Spy got Temp OOM and it didn't know what to do so it cancelled all of my operations and reset the connection. As a result I put in a bug fix that simply added on only the Temp OOM error code. This change adds all of the forgotten error codes so that in the future we don't end up with issues like I did again. So in short before was broken and after is fixed.

I am curious here to get you opinion on where we should add testing. I could add it at the low level right now or we can wait for the improvement on top of this, adding the ability for the user to get the operation status of a failed or succeeded operation. I could then check that the operations that are currently suposed to fail are failing with the correct failure.

-------------------------------------
author: Andreas Short
date: 2011-06-16 01:07:19.335000000

Patch Set 1:

Fair point on the before/after, but at least with this we can be testing expected results for operations that are handled by a MemcachedNode after going through the queue, handed to the node, etc.

For example, look at the testing with the mock node here:
https://github.com/Noah Dean/java-memcached-client/commit/a0d16ef3936c1b7e5d2b9480ed9a0a577cc811d2

-------------------------------------
author: Tate Garrett
date: 2011-06-21 22:45:33.934000000

Your change could not be merged due to a path conflict.

Please merge (or rebase) the change locally and upload the resolution for review.

-------------------------------------
