#282 periodic heartbeat to prevent Docker idle timeout#282
Open
VasilevNStas wants to merge 1 commit into
Open
Conversation
Long-running judges sessions can exceed Docker's stdout-idle timeout, causing the container to be killed. Emit a timestamped `[heartbeat]` line every HEARTBEAT_INTERVAL seconds (default 60) while judges runs. A trap on EXIT ensures the background heartbeat process is cleaned up even when judges fails (set -e).
Contributor
Author
Why this mattersDocker kills containers that produce no stdout for a configurable idle time (commonly 5–10 minutes). A The symptom is silent: the container disappears, After this PR, a heartbeat line arrives every 60s: Three benefits:
For jobs where 60s is too aggressive (or not aggressive enough), |
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.
Long-running
judges updatesessions can exceed Docker's stdout-idle timeout, causing the container to be killed silently.What this PR does
Emits a timestamped
[heartbeat]line to stdout everyHEARTBEAT_INTERVALseconds (default 60) while judges runs:A
trapon EXIT ensures the background heartbeat process is always cleaned up — even when judges fails viaset -e.Configuration
HEARTBEAT_INTERVAL60Checklist
bundle exec rubocop— 0 offencesbundle exec rake— all tasks pass@yegor256 please review