Async server reorders and drops client-stream DATA frames

Aperta
#340 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@shvbsle ci sta già lavorando.

Dal 13/11/2026.

  • #341 di @shvbsle — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
15/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
api

Direzione di ricerca

Start with ServerReader::handle_msg, which spawns a task per frame, and HandlerContext::handle_msg, where wait_tx is dropped before the DATA frame is sent to stream_tx. handle_stream has the same gap for the stream-init payload. Reproduce with the 20-stream, 200-frame ordering test under a single pinned CPU; done means every frame arrives once, in order, and REMOTE_CLOSED cannot overtake the last DATA frame.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description of problem

On the async server, client-to-server stream DATA frames can reach the handler out of order, and the REMOTE_CLOSED frame can overtake the last DATA frame and drop it. Also reported in https://github.com/aws/containers-roadmap/issues/2913.

ServerReader::handle_msg spawns a task per frame. For DATA frames, HandlerContext::handle_msg drops wait_tx (releasing the reader) before it pushes the frame onto the stream's channel, so consecutive frames of one stream race each other to stream_tx.send(). handle_stream has the same gap for the stream-init payload.

This is the server-side half of #311; #312 fixed only the client reader.

To reproduce: open 20 client-streaming streams on one connection, send 200 sequence-numbered frames each over 20 rounds, and check the order in the handler. The race needs a worker preempted inside that gap, so pin the process to one CPU alongside two busy threads.

Expected result

The handler receives every frame of a stream, once, in the order the client sent it.

Actual result

It fails every run on 0.10.0:

(frames out of order, frames received) of 80000 sent
  left: (3, 79939)
 right: (0, 80000)

Frames are reordered and some are lost silently, with no error on either side.

Lingua principale
Rust
Stelle
374
Fork
64
Merge medio
3g 5h
PR unite (30g)
6

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di containerd/ttrpc-rust

Tutte le issue di containerd/ttrpc-rust

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.