[router] fix pd prefill http request complinace issue (#9237)

This commit is contained in:
Simo Lin
2025-08-16 22:36:45 -07:00
committed by GitHub
parent fda762a27d
commit bb10e3a1c3

View File

@@ -886,12 +886,9 @@ impl PDRouter {
tokio::spawn(async move {
if let Ok(response) = prefill_future.await {
// Consume at most one small chunk with a very short timeout to advance flow control
let _ = tokio::time::timeout(Duration::from_millis(20), async {
let mut s = response.bytes_stream();
let _ = s.next().await;
})
.await;
// Consume the entire response body to maintain HTTP compliance
// This runs in the background and won't block the decode response
let _ = response.bytes().await;
}
});