By using provided buffers with send requests, the application can prevent any kind of reordering of the outgoing data which can otherwise occur if the application has more than one send request inflight for a single socket. This provides better pipelining of data, where previously the app needed to manually serialize sends.
Apparently, SendBundle does not prevent reordering.
Tested on: Linux 6.18.6-arch1-1
$ cargo run
Example output:
[...]
send completed with buf 14256, ws: 4096
send completed with buf 14257, ws: 4096
send completed with buf 14258, ws: 4096
send completed with buf 14259, ws: 4096
thread '<unnamed>' (465707) panicked at src/main.rs:110:13:
assertion `left == right` failed: Out of order byte received. Expected 64, got 178. (total_recv_bytes: 3410944)
left: 64
right: 178
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed
at /usr/src/debug/rust/rustc-1.92.0-src/library/core/src/panicking.rs:399:5
4: iou_sendbundle_reorder::server
at ./src/main.rs:110:13
5: iou_sendbundle_reorder::main::{{closure}}
at ./src/main.rs:28:49
The actual numbers (expected and got byte, stream position) varies run-by-run.
Expected: no assert.
I was unable to trigger the bug with --release.