Count pipeline errors per-command, not per-window - #124
Closed
fcostaoliveira wants to merge 1 commit into
Closed
Conversation
radix.Pipeline.Run stops decoding at the first failing command, drains (discards) the remaining replies, and returns a single aggregate error for the whole batch. flushPending then marked EVERY command in the pipeline window as errored, so one bad reply (e.g. a WRONGTYPE) in a window of N inflated the error count by up to N. Replace radix.Pipeline with a small custom Action (pipelineErrs) that still sends the whole batch in one buffered write (via multiMarshal) but decodes every reply and records each command's own error in errs[i]. flushPending now attributes hadError/isTimeout per command from that slice: a RESP error fails only its own command; a transport error (i/o timeout) fails that command and the ones after it (the connection is broken) while the already-decoded ones stay successful. The read cost is unchanged -- radix.Pipeline also decodes/drains all N replies. Regression guard: TestFTSBPipelineErrorCountedPerCommandNotPerWindow feeds one WRONGTYPE among 9 good HSETs in a pipeline of 10 (workers=1, deterministic) and asserts Errors==1. Verified the pre-fix binary reports Errors==10 for the same input. Existing error/timeout integration tests still pass.
|
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.



Closes #118.
Problem
radix.Pipeline.Runstops decoding at the first failing command, drains (discards) the remaining replies, and returns a single aggregate error for the whole batch.flushPendingthen marked every command in the pipeline window as errored — so one bad reply (e.g. aWRONGTYPE) in a window of N inflated the error count by up to N.Fix
Replace
radix.Pipelinewith a small customAction(pipelineErrs) that:multiMarshal) — pipelining is preserved;errs[i]instead of draining.flushPendingnow attributeshadError/isTimeoutper command:Read cost is unchanged —
radix.Pipelinealso decodes/drains all N replies. Everything is built on public radix interfaces (CmdActionembedsresp.Marshaler/resp.Unmarshaler;Conn.Encode/Decode), no internal-type assertions.Validation
TestFTSBPipelineErrorCountedPerCommandNotPerWindow: oneWRONGTYPEamong 9 goodHSETs in a pipeline of 10 (--workers 1, deterministic) → assertsErrors == 1.Negative control — same input, pre-fix binary:
TotalOps=20 Errors=10. Fixed binary:Errors=1. Existing error/timeout integration tests still pass; unit suite green under-race.