mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-10 03:09:50 +08:00
feat(gateway): harden failover and payload handling
Retry pre-response transport failures across candidates with an explicit stop policy, and propagate end-to-end timing into usage records and UI diagnostics. Remove legacy body, import, cookie, PII, and tunnel replay caps while preserving optional operator-configured gateway limits.
This commit is contained in:
@@ -127,4 +127,38 @@ mod tests {
|
||||
assert_eq!(trace.final_status, RequestCandidateFinalStatus::Failed);
|
||||
assert_eq!(trace.total_latency_ms, 33);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn request_candidate_trace_recovers_missing_transport_latency_from_timestamps() {
|
||||
let repository = Arc::new(InMemoryRequestCandidateRepository::seed(vec![
|
||||
sample_candidate(
|
||||
"cand-timeout",
|
||||
"req-failover",
|
||||
0,
|
||||
RequestCandidateStatus::Failed,
|
||||
Some(100),
|
||||
None,
|
||||
None,
|
||||
),
|
||||
sample_candidate(
|
||||
"cand-success",
|
||||
"req-failover",
|
||||
1,
|
||||
RequestCandidateStatus::Success,
|
||||
Some(101),
|
||||
Some(626),
|
||||
Some(200),
|
||||
),
|
||||
]));
|
||||
let state = GatewayDataState::with_request_candidate_reader_for_tests(repository);
|
||||
|
||||
let trace = read_request_candidate_trace(&state, "req-failover", true)
|
||||
.await
|
||||
.expect("trace should succeed")
|
||||
.expect("trace should exist");
|
||||
|
||||
assert_eq!(trace.total_candidates, 2);
|
||||
assert_eq!(trace.final_status, RequestCandidateFinalStatus::Success);
|
||||
assert_eq!(trace.total_latency_ms, 1_626);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user