Repository navigation
fix(resp): encode wire replies and isolate validated binary Redis commands - #16
Merged
Merged
Conversation
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.
RESP replies were encoded into empty fixed-size buffers, causing clients to wait indefinitely. Use the growing encoder and cover fragmented commands, pipelined replies, and protocol errors at the transport boundary.
Redis keys now use a binary-safe namespace that cannot overwrite HTTP cache entries. Validate arity, argument types, EX/PX values, unsupported options, and value sizes before mutation. SET without expiration persists until eviction/deletion; TTL returns -1 for persistent keys and -2 for absent keys. Return explicit errors for unsupported EXPIRE, bound incomplete frames to 8 MiB, and cancel client handlers on shutdown. RESP reads no longer update the comparison cache.
Validation: 58 Rust tests (including the prerequisite), including six command/transport regressions; cargo fmt; strict Clippy across all targets. Real TCP smoke checks covered SET/GET/TTL, binary key isolation, malformed SET preservation, and attempted HTTP-key poisoning.
This PR is stacked on #14 because the current CI Rust compiler rejects the original load-generator division code. Merge #14 first; the diff here contains only this improvement family.
Replaces #9 after removing the codex/ branch prefix. Commit contents are preserved; the original PR retains prior discussion and review history.