Skip to content

fix: premature recycles in MGetCache/JsonMGetCache helpers#983

Merged
rueian merged 1 commit intomainfrom
fix-cache-helpers-recycle
Apr 14, 2026
Merged

fix: premature recycles in MGetCache/JsonMGetCache helpers#983
rueian merged 1 commit intomainfrom
fix-cache-helpers-recycle

Conversation

@rueian
Copy link
Copy Markdown
Collaborator

@rueian rueian commented Apr 14, 2026

Note

Medium Risk
Adjusts pooled command buffer lifecycle around DoMultiCache, which can affect concurrency and correctness under load if mishandled. Scope is small but touches low-level client caching/pipelining behavior.

Overview
Fixes a pooling/lifecycle bug in MGetCache and JsonMGetCache where the mgetcachecmds buffer could be returned to mgetcachecmdsp before DoMultiCache finished using it.

doMultiCache now takes the command buffer (instead of a raw slice) and only returns it to the pool after all responses have been processed successfully, avoiding reuse on early exits due to non-Redis errors.

Reviewed by Cursor Bugbot for commit da23277. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: Rueian <rueiancsie@gmail.com>
@jit-ci
Copy link
Copy Markdown

jit-ci bot commented Apr 14, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@rueian rueian merged commit 316a14a into main Apr 14, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant