Data loss in ttrpc-rust A data-loss bug in containerd's ttrpc-rust protocol implementation caused the final log frame of a stream to be silently dropped, traced to a per-frame tokio::spawn in src/asynchronous/client.rs at commit f31f592 that let a FLAG_REMOTE_CLOSED frame remove a stream from the client's streams map before the preceding DATA frame's task looked it up. The author's fix removes the spawn so the reader task handles each frame in read order, but a reviewer noted the naive fix lets a full 100-message bounded mpsc channel block the reader and stall every other call on the connection, as reported in issue #311. The interactive version of this post, with animations, is at notes.shvbsle.in/ttrpc-data-loss https://notes.shvbsle.in/ttrpc-data-loss/ . Before the AI-accelerated programming age, it was expected from a software stack that all of its stable components are written in one uniform language. In the case of containers, the ecosystem containerd, shim, runc was written in Golang. But in this new age, armed with LLMs, any new language can make lateral entry in this ecosystem and quickly build stable runtimes. I've been trying to introduce more Rust to this ecosystem. One day I was watching logs from a pod that was running on a container runtime written in Rust and noticed that occasionally the log stream just abruptly ended. I deployed another pod that prints numbers from 1 to 100, and the logs sometimes abruptly ended on 99, but never on 97 or 98. I kept thinking that it was a bug in the runtime, but it turned out that the bug was hidden much deeper in the stack. It was in the implementation of the protocol