Spaces:
Paused
Paused
FTA7700 commited on
Commit ·
fbe330c
1
Parent(s): 9c5146c
Add HTTP/1.1-forced variant to network diagnostics to isolate PMTU/fragmentation hypothesis
Browse files- api/src/handlers/admin.rs +30 -2
api/src/handlers/admin.rs
CHANGED
|
@@ -766,8 +766,8 @@ pub async fn network_diagnostics() -> axum::Json<serde_json::Value> {
|
|
| 766 |
}
|
| 767 |
}
|
| 768 |
|
| 769 |
-
// Stage 3: full HTTPS round trip via reqwest, IP pinned
|
| 770 |
-
// — includes TLS handshake + request send + response
|
| 771 |
let t2 = Instant::now();
|
| 772 |
match reqwest::Client::builder()
|
| 773 |
.resolve(host, addr)
|
|
@@ -792,6 +792,34 @@ pub async fn network_diagnostics() -> axum::Json<serde_json::Value> {
|
|
| 792 |
results.insert("https_client_build_error".into(), serde_json::json!(e.to_string()));
|
| 793 |
}
|
| 794 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 795 |
}
|
| 796 |
|
| 797 |
// Stage 4: raw IPv6 connect test against a known-good public IPv6 address (Cloudflare 1.1.1.1),
|
|
|
|
| 766 |
}
|
| 767 |
}
|
| 768 |
|
| 769 |
+
// Stage 3: full HTTPS round trip via reqwest (default, HTTP/2-eligible), IP pinned
|
| 770 |
+
// to the resolved address — includes TLS handshake + request send + response.
|
| 771 |
let t2 = Instant::now();
|
| 772 |
match reqwest::Client::builder()
|
| 773 |
.resolve(host, addr)
|
|
|
|
| 792 |
results.insert("https_client_build_error".into(), serde_json::json!(e.to_string()));
|
| 793 |
}
|
| 794 |
}
|
| 795 |
+
|
| 796 |
+
// Stage 3b: same request, but forced to HTTP/1.1 only — isolates whether a
|
| 797 |
+
// PMTU/fragmentation blackhole on larger HTTP/2 handshake/frame packets is the cause.
|
| 798 |
+
let t2b = Instant::now();
|
| 799 |
+
match reqwest::Client::builder()
|
| 800 |
+
.resolve(host, addr)
|
| 801 |
+
.timeout(std::time::Duration::from_secs(12))
|
| 802 |
+
.http1_only()
|
| 803 |
+
.build()
|
| 804 |
+
{
|
| 805 |
+
Ok(client) => {
|
| 806 |
+
let resp = client.get(format!("https://{host}/health")).send().await;
|
| 807 |
+
let full_ms = t2b.elapsed().as_millis();
|
| 808 |
+
match resp {
|
| 809 |
+
Ok(r) => {
|
| 810 |
+
results.insert("https_h1_full_ms".into(), serde_json::json!(full_ms));
|
| 811 |
+
results.insert("https_h1_status".into(), serde_json::json!(r.status().as_u16()));
|
| 812 |
+
}
|
| 813 |
+
Err(e) => {
|
| 814 |
+
results.insert("https_h1_full_ms".into(), serde_json::json!(full_ms));
|
| 815 |
+
results.insert("https_h1_error".into(), serde_json::json!(e.to_string()));
|
| 816 |
+
}
|
| 817 |
+
}
|
| 818 |
+
}
|
| 819 |
+
Err(e) => {
|
| 820 |
+
results.insert("https_h1_client_build_error".into(), serde_json::json!(e.to_string()));
|
| 821 |
+
}
|
| 822 |
+
}
|
| 823 |
}
|
| 824 |
|
| 825 |
// Stage 4: raw IPv6 connect test against a known-good public IPv6 address (Cloudflare 1.1.1.1),
|