Repository navigation
l7: parse memcached delete commands without trailing arguments - #384
Closed
RaphaelFakhri wants to merge 1 commit into
Closed
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
ParseMemcached expected a space after the key, so the common "delete <key>\r\n" form returned an empty command and the span was dropped. Fall back to the end of the line when no space follows the key.
Member
|
@RaphaelFakhri just curious, how does knowing the key help you personally? What use case do you have for seeing the actual Memcached key in traces? |
Author
|
@def I found this while reading the Memcached parser, not from a deployment of my own. The effect is wider than the key: for |
Member
|
If there are no practical reasons for this change, I'll close this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ParseMemcachedreads the key ofset,add,delete,incr, and similar commands by cutting the payload at the first space after the key. The standarddelete <key>\r\ncommand has nothing after the key, so the parser returned an empty command.Trace.MemcachedQuerythen skipped the span, so memcacheddeletecalls never showed up in traces, even though the eBPF filter (is_memcached_query) captures them.This change falls back to the end of the line when no space follows the key.
Testing
delete 1111\r\nanddelete 1111 noreply\r\ncases toTest_parseMemcached.go test ./ebpftracer/l7/passes. Without the fix, the newdelete 1111\r\ncase fails withexpected: "delete", actual: "".gofmt,goimports, andgo vetreport no issues for the package.