fix: address pipeline-reliability verify findings

Close the source image after converting to RGBA so PNGs at the pixel limit
fit the render memory limit. Strengthen the fencing test so that it fails
without the attempt check, and measure worker and relay stops under load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 18:55:38 +03:00
co-authored by Claude Opus 5.5
parent 6bd60532aa
commit 399da054f2
19 changed files with 596 additions and 41 deletions
+5 -1
View File
@@ -81,7 +81,11 @@ def _prepared(image: Image.Image) -> Image.Image:
# вырос бы с ~320 до ~480 МиБ
return image
if image.mode in _ALPHA_MODES or "transparency" in image.info:
return image.convert("RGBA")
converted = image.convert("RGBA")
# исходник дальше не нужен: на 40 млн пикселей с ним на время масштаба
# пик выше лимита процесса (четыре байта на пиксель у LA и RGB тоже)
image.close()
return converted
if image.mode == "1":
return image.convert("L")
if image.mode in ("P", "CMYK"):