Merge branch 'fawney19:main' into main

This commit is contained in:
ZheFox
2026-05-26 15:56:17 +08:00
committed by GitHub
@@ -538,6 +538,10 @@ fn resolve_stream_candidate_watchdog_timeout(
Duration::from_millis(timeout_ms) Duration::from_millis(timeout_ms)
} }
fn stream_candidate_watchdog_timeout_message() -> &'static str {
"Stream first byte timeout"
}
async fn execute_stream_candidate_with_watchdog<Fut>( async fn execute_stream_candidate_with_watchdog<Fut>(
state: &(impl RequestCandidateRuntimeWriter + ?Sized), state: &(impl RequestCandidateRuntimeWriter + ?Sized),
trace_id: &str, trace_id: &str,
@@ -577,9 +581,7 @@ where
status: RequestCandidateStatus::Failed, status: RequestCandidateStatus::Failed,
status_code: Some(http::StatusCode::GATEWAY_TIMEOUT.as_u16()), status_code: Some(http::StatusCode::GATEWAY_TIMEOUT.as_u16()),
error_type: Some("local_stream_candidate_watchdog_timeout".to_string()), error_type: Some("local_stream_candidate_watchdog_timeout".to_string()),
error_message: Some(format!( error_message: Some(stream_candidate_watchdog_timeout_message().to_string()),
"local stream candidate attempt exceeded watchdog timeout of {timeout_ms}ms"
)),
latency_ms: None, latency_ms: None,
started_at_unix_ms: Some(candidate_started_unix_ms), started_at_unix_ms: Some(candidate_started_unix_ms),
finished_at_unix_ms: Some(finished_at_unix_ms), finished_at_unix_ms: Some(finished_at_unix_ms),
@@ -899,7 +901,7 @@ mod tests {
assert!(record assert!(record
.error_message .error_message
.as_deref() .as_deref()
.is_some_and(|message| message.contains("25ms"))); .is_some_and(|message| message == "Stream first byte timeout"));
assert_eq!(record.candidate_index, 2); assert_eq!(record.candidate_index, 2);
} }
} }