Summary
The Bedrock guardrail HTTP call in crates/aisix-guardrail/src/guardrails/bedrock.rs currently relies on reqwest's default timeout from Client::new() without an explicit per-request timeout override. Since this guardrail check is latency-sensitive, an explicit timeout should be configured to ensure bounded wait time.
Suggested Fix
Add a per-request .timeout(...) call before .send().await:
let response = self
.client
.post(signed.url)
.headers(signed.headers)
.timeout(std::time::Duration::from_secs(10))
.body(body)
.send()
.await?;
The specific timeout value (e.g., 5s, 10s) should be decided based on acceptable latency bounds for guardrail checks.
References
Reported by @bzp2010
Summary
The Bedrock guardrail HTTP call in
crates/aisix-guardrail/src/guardrails/bedrock.rscurrently relies on reqwest's default timeout fromClient::new()without an explicit per-request timeout override. Since this guardrail check is latency-sensitive, an explicit timeout should be configured to ensure bounded wait time.Suggested Fix
Add a per-request
.timeout(...)call before.send().await:The specific timeout value (e.g., 5s, 10s) should be decided based on acceptable latency bounds for guardrail checks.
References
Reported by @bzp2010