[router] fix pd prefill http request complinace issue (#9237)
This commit is contained in:
@@ -886,12 +886,9 @@ impl PDRouter {
|
|||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
if let Ok(response) = prefill_future.await {
|
if let Ok(response) = prefill_future.await {
|
||||||
// Consume at most one small chunk with a very short timeout to advance flow control
|
// Consume the entire response body to maintain HTTP compliance
|
||||||
let _ = tokio::time::timeout(Duration::from_millis(20), async {
|
// This runs in the background and won't block the decode response
|
||||||
let mut s = response.bytes_stream();
|
let _ = response.bytes().await;
|
||||||
let _ = s.next().await;
|
|
||||||
})
|
|
||||||
.await;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user