fix(orchestrate): bound run_render's wait and disambiguate its failure - #229
Merged
Merged
Conversation
… its failure Add RENDER_TIMEOUT_S (~30 min) so an OS-level stall in render.py can no longer block the unattended cron indefinitely (#64); a subprocess.TimeoutExpired is caught and re-raised as RenderError, following summarize_item's existing pattern. Also split run_render's merged failure branch into three distinguishable RenderError messages - non-zero exit, timeout, and exit-0-but-unparseable-stdout (#71) - so main()'s FAILED line names the actual cause instead of echoing whatever happened to print last, which could be a late-success log line. Closes #64 Closes #71 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RENDER_TIMEOUT_S(~30 min) and pass it torun_render's subprocess call so an OS-level stall inrender.pycan't block the unattended cron indefinitely; asubprocess.TimeoutExpiredis caught and re-raised asRenderError, followingsummarize_item's existing pattern (Add a subprocess timeout to run_render in orchestrate.py #64).run_render's single merged failure branch into three distinguishableRenderErrormessages: non-zero exit, timeout, and exit-0-but-unparseable-stdout — somain()'sFAILED <reason>line names the actual cause instead of echoing whatever line happened to print last, which could be a late-success log line (Make run_render's RenderError message diagnostic instead of the last stdout line #71).Both issues touch the same function, so they're landed together to avoid a guaranteed merge conflict.
Test plan
TimeoutExpiredraisesRenderErrormentioning "timed out", and a returncode-0/unparseable-stdout case raisesRenderErrormentioning "unparseable" (not the bare last printed line).test_run_render_raises_on_failure(non-zero exit) still passes unchanged.python3 -m pytest -q— 1552 passed, 0 failed.ruff checkandruff format --check— clean on both changed files.Closes #64
Closes #71
🤖 Generated with Claude Code