[router] fix pd prefill http request complinace issue (#9237)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user