From 017955ad9e1bb51c8f30b36b3b8d1662b431911d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1lm=C3=A1n=20=E2=80=9EKAMI=E2=80=9D=20Szalai?= Date: Fri, 4 Sep 2026 11:49:36 +0200 Subject: [PATCH] Fix crash on IncompleteRead, which killed the first live run The first scheduled run of #1157's workflows failed outright: a server started a chunked HTTP response and then hung up mid-chunk, which urllib surfaces as http.client.IncompleteRead - a subclass of http.client.HTTPException, not of OSError/URLError/ValueError, so probe()'s except clause let it propagate and took the whole run down before it wrote anything to --json, including check_channels_fast.yml's run.jsonl. Catch http.client.HTTPException alongside the existing exceptions and treat it as unreachable, same as any other broken connection. Verified against the exact exception (mocked) and against the live lists. --- check_channels.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/check_channels.py b/check_channels.py index 5cb862b..628d9b7 100644 --- a/check_channels.py +++ b/check_channels.py @@ -51,6 +51,7 @@ Usage: """ import argparse +import http.client import json import os import re @@ -139,7 +140,10 @@ def probe(url, timeout): if error.code in REFUSING_CODES: return REFUSED return UNREACHABLE - except (urllib.error.URLError, OSError, ValueError): + except (urllib.error.URLError, OSError, ValueError, http.client.HTTPException): + # http.client.HTTPException covers a server that started a chunked + # response and then hung up mid-chunk (IncompleteRead) and similar + # low-level protocol violations - a broken connection, not a bad URL return UNREACHABLE return OK if looks_like_a_playlist(head) else GONE