add inline redis protocol support#3024
Merged
wwbmmm merged 7 commits intoJul 25, 2025
Merged
Conversation
Contributor
Author
|
@chenBright Hi, could you please restart the CI, I see all the failures happened when installing dependencies. |
Contributor
|
@thweetkomputer Thanks for your contribution! Would you please add some unit tests for this feature? |
Contributor
Author
Hi @wwbmmm , thanks for replying, I added the test. |
Contributor
|
LGTM |
chenBright
reviewed
Jul 18, 2025
Contributor
Author
|
Thanks @chenBright , I fixed it. |
Contributor
Author
|
Hi, how can this PR be merged? |
wwbmmm
pushed a commit
that referenced
this pull request
Aug 2, 2025
* add inline redis protocol support * complete code * add check * fix * add inline unitest * use find * fix
chenBright
pushed a commit
that referenced
this pull request
Jun 14, 2026
Inline redis protocol support (#3024) accepts any alpha-leading line as an inline command. The HTTP/2 client connection preface ("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n") is alpha-leading, so it was parsed as an inline command instead of returning PARSE_ERROR_TRY_OTHERS. This prevented protocol auto-detection from falling through to HTTP/2, and gRPC clients calling a server with redis_service enabled failed with "connection closed before server preface received". Detect the HTTP/2 preface (fully, or as a not-yet-complete prefix) in the inline branch of RedisCommandParser::ConsumeImpl and defer to other protocols. A command-name blacklist is not viable because some HTTP methods are also valid redis commands (e.g. GET), whereas the preface is a fixed magic string that no redis command begins with, making the check unambiguous. Add RedisTest.inline_does_not_eat_h2_preface covering the full preface, a partial prefix, and a genuine inline command sharing the leading byte. Co-authored-by: rajvarun77 <287367605+rajvarun77@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What problem does this PR solve?
Issue Number:
Problem Summary:
Add inline redis protocol support. Many redis benchmark tools use inline protocol, such as
redis_benchmark,dfly_bench, although inline protocol is not guaranteed to be support for a redis-compatible database.What is changed and the side effects?
Changed:
Side effects:
There will be no overhead for commands following normal protocol (RESP2).
No compatiblity issues should be introduced unless someone replies on brpc to reject inline commands.
Check List: