mirror of https://github.com/Free-TV/IPTV
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.pull/1158/head
parent
e52f1b34d8
commit
017955ad9e
|
|
@ -51,6 +51,7 @@ Usage:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import http.client
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
@ -139,7 +140,10 @@ def probe(url, timeout):
|
||||||
if error.code in REFUSING_CODES:
|
if error.code in REFUSING_CODES:
|
||||||
return REFUSED
|
return REFUSED
|
||||||
return UNREACHABLE
|
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 UNREACHABLE
|
||||||
return OK if looks_like_a_playlist(head) else GONE
|
return OK if looks_like_a_playlist(head) else GONE
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue