Wrap Augustus rerun extraction in timeout-safe error handling#1170
Merged
Conversation
Individual Augustus jobs in funannotate-BUSCO2.py had no timeout, so a hung job would block the entire BUSCO training run indefinitely. Adds: - --augustus_timeout (default 300s): kills stuck Augustus jobs using SIGKILL on the process group (start_new_session=True is thread-safe; avoids orphaning the augustus child under shell=True) - per-job elapsed time tracking across all worker threads with a summary log after the Augustus pass (mean, median, max, timeout count) so users can empirically tune the timeout value - try/except around _extract calls to survive any truncated output files left by killed jobs, losing at most one gene per timeout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Passes the per-job Augustus timeout through to funannotate-BUSCO2.py via --augustus_timeout. Default is 300s, matching the BUSCO2 script default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #1169 where Augustus can hang indefinitely during BUSCO-based training by introducing a per-job timeout that kills long-running Augustus subprocesses and allows the overall run to continue.
Changes:
- Added
--augustus_timeouttofunannotate-BUSCO2.pyand enforced per-job timeouts in threaded Augustus execution (with timing/timeout summary logging). - Forwarded a new
funannotate predictCLI option (--augustus_BUSCO_timeout) into the BUSCO2 wrapper as--augustus_timeout. - Documented the new behavior and flags in
CHANGES.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
funannotate/predict.py |
Adds a new CLI flag and forwards it to the BUSCO2 subprocess invocation. |
funannotate/aux_scripts/funannotate-BUSCO2.py |
Implements per-job Augustus timeouts, kill logic, and post-run timing/timeout logging. |
CHANGES.md |
Documents the new timeout feature and related CLI options. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot
AI
changed the title
Enable augustustimeout busco
Wrap Augustus rerun extraction in timeout-safe error handling
Jun 7, 2026
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.
_augustus_reruncalled_extract()without any error handling, meaning a timed-out or truncated Augustus output file in the second pass would crash the entire run. The first-pass extraction already had atry/exceptguard; the second pass was missing it.Change
_augustus_rerunextraction loop (funannotate-BUSCO2.py~L1502): wrapped_extract(mainout, plain_name)and_extract(mainout, plain_name, aa=False)in the sametry/except Exceptionblock used by the first-pass loop, logging a warning and skipping the offending file rather than propagating the exception.This makes timeout resilience consistent across both Augustus passes.