fix(ioredis): trace each command once when replayed from the offline queue #10931
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 243 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.329
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10931"
general
weight: 0.35
tlhunter
What does this PR do?
Prevents duplicate
redis.commandspans when ioredis passes the same command throughRedis.prototype.sendCommandmore than once. The wrapper marks a command with a module-private symbol when it starts its span, and passes later calls for that command straight through.Motivation
ioredis reuses the same
Commandobject when it:enableAutoPipeliningis set),autoResendUnfulfilledCommands, on by default),reconnectOnErrorreturned2.Each call started a new span, so one command sent over the wire was reported as two or more
redis.commandspans. Since every replay path reuses the object, a flag on the command covers all of them without tracking queues or wrapping connection state changes. ioredis 5.11 deduplicates its own native tracing the same way (command.isTraced); this uses a separate symbol so it doesn't interfere with that.Test evidence
6ddd5a7fd: ioredis job. The "while connecting" test fails on every supported ioredis version with2 !== 1.reconnectOnErrortest fails on every supported ioredis version against the previous fix on this branch, with3 !== 1.PLUGINS=ioredis SPEC=index npm run test:plugins— 200 passing across installed ioredis versions 2–6. ESLint passes for both changed files.Additional Notes
reconnectOnError.🤖 Generated with Claude Code