Add DoRaw and DoRawWriteTo for raw RESP protocol access#3713
Merged
Conversation
ndyakov
reviewed
Feb 19, 2026
ndyakov
left a comment
Member
There was a problem hiding this comment.
Left some comments, let's discuss and test if we can directly use io.Copy when we use a writer.
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
…aw-response-command
a02cc5b to
f531cad
Compare
ndyakov
previously approved these changes
Mar 12, 2026
Member
|
@fdimuccio please take a look if this covers your usecase. I am willing to proceed with this PR and merge it. |
|
@ndyakov it looks perfect, DoRawWriteTo is exactly what I was looking for. Thank you! |
…aw-response-command
6719b5c to
f09cc8d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
ndyakov
pushed a commit
to olde-ducke/go-redis
that referenced
this pull request
Mar 23, 2026
…redis#3713) * Add DoRaw and DoRawWriteTo for raw RESP protocol access * fix augment comments * Pipeline retry fix * Fix Missing NoRetry check in cluster and ring retry loops
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.

Adds two new methods for accessing raw RESP protocol bytes:
DoRaw(ctx, args...)- Returns raw RESP bytes, useful for custom parsingDoRawWriteTo(ctx, writer, args...)- Streams RESP bytes directly to an io.Writer without intermediate allocationsAdd RawCmd and RawWriteToCmd types that return raw RESP protocol bytes
without parsing, allowing users to implement custom deserialization.
Closes #3698
Note
Medium Risk
Adds new raw-reply execution paths and modifies core retry behavior (single and pipelined, including cluster/ring) to honor a new
NoRetrycontract, which could affect failure handling if misapplied.Overview
Adds
DoRawandDoRawWriteToAPIs plus new command types (RawCmd,RawWriteToCmd) to let callers receive raw RESP replies as bytes or stream them directly to anio.Writer.Implements raw-reply reading in
proto.Reader(buffered and streaming, including nested types and RESP3 attributes) and introduces aCmder.NoRetry()flag; retry loops for standalone commands and pipelines (including cluster/ring) now skip retries when any command is marked non-retryable to avoid partial-write corruption. Tests are expanded to validate raw outputs across common reply types and the new no-retry behavior.Written by Cursor Bugbot for commit 4150e19. This will update automatically on new commits. Configure here.