fix: address cubic review findings from PR #4#5
Merged
vieiralucas merged 1 commit intomainfrom Mar 25, 2026
Merged
Conversation
- client.go: handle both value and pointer AccumulatorModeDisabled in type assertion to prevent accumulator from starting unexpectedly - accumulator.go: cap runAuto drain loop at maxAutoBatchSize (1000) to prevent exceeding gRPC 4MB max message size under high throughput - enqueue.go: validate EnqueueMany response result count matches input message count, fill missing results with explicit errors - proto: add reserved directives for removed field numbers in EnqueueRequest, ConsumeResponse, AckRequest, NackRequest to prevent accidental field number reuse
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.
Summary
Addresses all 4 Cubic findings from PR #4 that were merged without fixes:
*AccumulatorModeDisabled). Switched to type switch covering both value and pointer types.runAutodrain loop had no cap on batch size, risking gRPCResourceExhaustedunder high throughput. AddedmaxAutoBatchSize(1000) cap, consistent withrunLinger'smaxSizebehavior.EnqueueManydid not validate response result count matched input. Now allocates results based on input length and fills missing slots with explicit errors.reserveddirectives. Addedreservedto prevent accidental reuse.Test plan
go build ./...passesgo vet ./...passesSummary by cubic
Fixes four issues from PR #4 to improve correctness and stability. Prevents unintended accumulator start, caps auto batch size, validates
EnqueueManyresults, and reserves removed proto fields to avoid future conflicts.maxAutoBatchSize(1000) to avoid gRPC message size issues.EnqueueManynow allocates results by input length and surfaces errors when the server returns fewer results.reservednumbers for removed fields in EnqueueRequest, ConsumeResponse, AckRequest, and NackRequest to prevent accidental reuse.Written for commit 6e16884. Summary will update on new commits.