gwhalin/Memcached-Java-Client — Issue #34: NumberFormat exception in AsciiClient
Author: joongonn
Created: 2011-11-28 23:36:08+00:00
State: open

After upgrading to 2.6.2, we're intermittently getting the below exceptions (against 1.4.5 server).

----
ERROR 2011-11-28 23:00:01,141 [com.danga.MemCached.MemCachedClient 740206481@qtp-1696446139-18735] For input string: "command"
java.lang.NumberFormatException: For input string: "command"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.parseInt(Integer.java:499)
at com.schooner.MemCached.AscIIClient.get(AscIIClient.java:734)
----

Looked into the code and found that it should be due to a breakdown of the below typical 'get' conversation with the server. Eg. a HIT yields

# setting a key
set the_key 1 0 13
Just a number

# retrieving the key
get the_key
VALUE the_key 32 13
Just a number
END

For the exception scenario, it seems that the AsciiClient was trying to pass a response from the server that looked like "VALUE the_key *command* xxx". Wondering where did the 'command' keyword came from.

Anyone facing the same issue?