Bug 745828 (EDG-56)

Summary: stats command processing doesn't allow command arguments
Product: [JBoss] JBoss Data Grid 5 Reporter: Michal Linhard <mlinhard>
Component: InfinispanAssignee: Default User <jbpapp-maint>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: nobody
Target Milestone: ---   
Target Release: EAP 5.1.0 EDG TP   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/EDG-56
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-26 12:05:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Michal Linhard 2010-11-19 14:32:57 UTC
project_key: EDG

in memcached server module, stats command is processed in a way that it isn't read as a whole line

after the input "stats" is read we're not reading the input till the end of the line but treating the next input as next command:

eg input "stats delete a\r" results to output:
STAT pid 0
....
STAT conn_yields 0
END
NOT_FOUND

input "stats bla\r" leads to
STAT pid 0
....
STAT conn_yields 0
END
SERVER_ERROR org.infinispan.server.core.UnknownOperationException: Unknown operation: bla

regarding stats we should be prepared for this kind of input:
"stats\r\n"
"stats <args>\r\n"

ie client might pass some additional arguments after stats command, which are not to be interpreted as next command.
(we need to read the whole line to the end.)

Comment 1 Galder Zamarreño 2010-11-22 11:31:39 UTC
Even though it's not documented (I should do so) stats <args> is basically not implemented due to the following notes in the protocol:

"stats <args>\r\n

Depending on <args>, various internal data is sent by the server. The
kinds of arguments and the data sent are not documented in this vesion
of the protocol, and are subject to change for the convenience of
memcache developers."

Basically, args is internal and hence not documented. So the only format supported should be: stats\r\n

So, I'd suggest closing this JIRA and I'll update the docu accordingly. Ok?

Comment 2 Michal Linhard 2010-11-22 13:34:35 UTC
I see why we don't support stats args.
my point is that we should read the whole input "stats <args>\r\n" anyway
and report something like 
"SERVER_ERROR arguments in stats command are not supported\r\n"

depending on the argument there will be probably some further erroneous input, but I think we should handle the input in "line mode".

Comment 3 Galder Zamarreño 2010-11-24 12:39:19 UTC
Fair point, I'll add a JIRA for that and to update the docu accordingly.

Comment 4 Galder Zamarreño 2010-11-24 12:45:43 UTC
Link: Added: This issue depends ISPN-793