{{ message }}
Limit Redis inline command allocation#3363
Open
wwbmmm wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Redis inline command parser to avoid repeated arena allocations/copies while waiting for \r\n, and enforces redis_max_allocation_size on inline command lines (rejecting oversized inline commands). It also adds regression coverage for oversized inline inputs and pipelined inline parsing.
Changes:
- Scan for
\r\nin inline commands before allocating from the parser arena, and only copy the current inline line once it is complete. - Enforce
redis_max_allocation_sizefor inline command line length (reject over-limit inline commands). - Extend unit tests to cover oversized inline commands and pipelined inline input where the next command is incomplete/oversized.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…n_size and ends with '\r'
Contributor
Author
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: null
Problem Summary:
Redis inline command parsing copied the full input buffer before checking
whether a complete line had arrived. A long pending inline command could make
the parser repeatedly allocate and copy buffered data while waiting for CRLF.
What is changed and the side effects?
Changed:
redis_max_allocation_sizeto the current inline command line.and for pipelined inline input with a large incomplete next command.
Side effects:
arena memory while waiting for CRLF, and complete inline commands only copy
the current line.
redis_max_allocation_sizeare now rejected.Check List: