From 72288bba82e4363a0d3095a459f054129b6fc3f3 Mon Sep 17 00:00:00 2001 From: "juancarlos.cavero" Date: Wed, 19 Aug 2026 17:11:10 +0200 Subject: [PATCH] fix(alerts): probe the proxy over plain HTTP HTTPS through DataImpulse fails in httpx with an SSL record-layer error even when the proxy is healthy (verified against a working proxy right after the top-up; yt-dlp's stack tunnels the same proxy fine), so an HTTPS probe would report a permanent false outage. An exhausted balance rejects the request at the proxy before forwarding, so plain HTTP still catches the 407. --- cloud/alerts.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cloud/alerts.py b/cloud/alerts.py index 8357430..f62d81b 100644 --- a/cloud/alerts.py +++ b/cloud/alerts.py @@ -165,7 +165,11 @@ async def record_job_outcome(ok: bool, error_text: str = ""): _PROXY_PROBE_INTERVAL = 1800 # seconds between probes (30 min) _PROXY_RENOTIFY = 7200 # keep nagging every 2 h while it stays down # 204-No-Content endpoint: the probe costs a handful of bytes of paid traffic. -_PROXY_PROBE_URL = "https://www.google.com/generate_204" +# Plain HTTP on purpose: HTTPS through DataImpulse fails in httpx with an SSL +# record-layer error even when the proxy is healthy (yt-dlp's stack is fine +# with it), which would make an HTTPS probe cry wolf. An exhausted balance +# rejects the request before forwarding, so HTTP still detects the 407. +_PROXY_PROBE_URL = "http://www.google.com/generate_204" _proxy_down_since = None _proxy_last_nag = 0.0