diff --git a/linkerd/http/retry/src/replay.rs b/linkerd/http/retry/src/replay.rs index 66ee9625e2..4a28806fa7 100644 --- a/linkerd/http/retry/src/replay.rs +++ b/linkerd/http/retry/src/replay.rs @@ -189,6 +189,7 @@ where tracing::trace!("Cannot replay buffered body, maximum buffer length reached"); return Poll::Ready(Some(Err(Capped.into()))); } + this.replay_body = false; } if this.replay_trailers { this.replay_trailers = false; diff --git a/linkerd/http/retry/src/replay/tests.rs b/linkerd/http/retry/src/replay/tests.rs index 3094b4b70f..e103ea5424 100644 --- a/linkerd/http/retry/src/replay/tests.rs +++ b/linkerd/http/retry/src/replay/tests.rs @@ -46,6 +46,23 @@ async fn replays_one_chunk() { } } +#[tokio::test] +async fn replays_unpolled_body() { + let Test { + mut tx, + initial, + replay, + _trace, + } = Test::new(); + tx.send_data("hello world").await; + drop(tx); + drop(initial); + + let (data, trailers) = body_to_string(replay).await; + assert_eq!(data, "hello world"); + assert_eq!(trailers, None); +} + #[tokio::test] async fn replays_several_chunks() { let Test {