[DEV-1818] Fix batchAppend cross-stream error contamination#523
Conversation
7c46e23 to
27afe28
Compare
27afe28 to
bb9cb4a
Compare
PR Summary by QodoScope batchAppend promise bank per stream to prevent cross-stream contamination Description
Diagram
High-Level Assessment
Files changed (2)
|
* Scope batchAppend promise bank per stream * Add debug log for dropped batchAppend responses * Add batchAppend coverage for erroring stream's own appends
batchAppendused a single process-global promise bank shared by every client and stream. A transport error on one stream rejected and cleared in-flight appends belonging to unrelated streams, and a latedataresponse after the bank was cleared crashed withTypeError: undefined is not iterable.Each stream now owns its own promise bank, so an error only affects appends on the stream that actually failed. A
dataresponse with no matching correlation id is dropped (and logged viadebug.command_grpc) instead of crashing.Regression test asserts that when one stream errors:
Both appends are asserted still-pending immediately before the error is emitted, so a fast server response surfaces as a failure rather than a silent pass.