Skip to content
Prev Previous commit
Next Next commit
fix s2_output buffer size limit to respect S2 1MB per-record constraint
  • Loading branch information
Mrhs121 committed Mar 23, 2026
commit 35388a2ebcaa01a162b6096cf94c8e0b73a28860
4 changes: 3 additions & 1 deletion crates/adapters/src/transport/s2/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ impl OutputEndpoint for S2OutputEndpoint {
}

fn max_buffer_size_bytes(&self) -> usize {
usize::MAX
// S2 enforces a 1MB limit per AppendRecord.
// Use a conservative limit to leave room for framing overhead.
1_000_000
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

push_buffer submits and immediately awaits the ack before returning — one round-trip per buffer. For real throughput: pipeline submits and wait for acks at flush/disconnect. Not a hard blocker for a first pass, but add a TODO so it isn't forgotten.

fn push_buffer(&mut self, buffer: &[u8]) -> AnyResult<()> {
Expand Down