Skip to content

Stop Pandoc when its conversion timeout expires - #485

Merged
MarekSuchanek merged 1 commit into
mainfrom
fix/pandoc-timeout
Nov 18, 2026
Merged

MarekSuchanek merged 1 commit into
mainfrom
fix/pandoc-timeout

Conversation

@MarekSuchanek

Copy link
Copy Markdown
Member

run_conversion called communicate(timeout=...) inside with proc:, so on timeout Popen.__exit__ waited for Pandoc without a limit and the timeout had no effect. Pandoc now runs in its own process group, which is killed and reaped on timeout (and on any other exception), so filters it started stop too. Output goes to temporary files instead of pipes, and the error message keeps only the end of stderr.

@MarekSuchanek MarekSuchanek self-assigned this Nov 18, 2026
`run_conversion` called `communicate(timeout=...)` inside `with proc:`, so on
timeout `Popen.__exit__` waited for Pandoc without a limit and the timeout had
no effect. Pandoc now runs in its own process group, which is killed and
reaped on timeout (and on any other exception), so filters it started stop
too. Output goes to temporary files instead of pipes, and the error message
keeps only the end of stderr.
@MarekSuchanek
MarekSuchanek merged commit ecc56d4 into main Nov 18, 2026
37 checks passed
@MarekSuchanek
MarekSuchanek deleted the fix/pandoc-timeout branch November 18, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant