Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

libpod: fix healthchecks not executing every interval on linux#27330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
winterqt wants to merge1 commit intocontainers:main
base:main
Choose a base branch
Loading
fromwinterqt:push-pwouqluolwxt
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
libpod: fix healthchecks not executing every interval on linux
By default, systemd sets a limit of how many times a service can start,which means that if you have a healthcheck that runs more often than thelimits, systemd will refuse to start it with a message like "Start requestrepeated too quickly." emitted to the journal.Signed-off-by: Winter M <winter@antithesis.com>Signed-off-by: Paul Holzinger <pholzing@redhat.com>
  • Loading branch information
@winterqt@Luap99
winterqt authored andLuap99 committedNov 26, 2025
commited6f63af10d59d1923a0e4b931977510cabed1ac
3 changes: 2 additions & 1 deletionlibpod/healthcheck_linux.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,7 +40,8 @@ func (c *Container) createTimer(interval string, isStartup bool) error {
cmd = append(cmd, "--setenv=PATH="+path)
}

cmd = append(cmd, "--unit", hcUnitName, fmt.Sprintf("--on-unit-inactive=%s", interval), "--timer-property=AccuracySec=1s", podman)
// StartLimitIntervalSec=0 so we don't hit the restart limit
cmd = append(cmd, "--unit", hcUnitName, fmt.Sprintf("--on-unit-inactive=%s", interval), "--timer-property=AccuracySec=1s", "--property=StartLimitIntervalSec=0", podman)

if logrus.IsLevelEnabled(logrus.DebugLevel) {
cmd = append(cmd, "--log-level=debug", "--syslog")
Expand Down
5 changes: 5 additions & 0 deletionstest/system/220-healthcheck.bats
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -104,6 +104,11 @@ Log[-1].Output | \"Uh-oh on stdout!\\\nUh-oh on stderr!\\\n\"
assert "$cidmatch" =~ " $cid-[0-9a-f]+\.timer *.*/podman healthcheck run $cid" \
"Healthcheck systemd unit exists"

# Check that the right service option is applied so we don't hit the systemd restart limit.
# Even though the code sets StartLimitIntervalSec the systemd command prints StartLimitInterval*U*Sec
run -0 systemctl show "$cid-*.service"
assert "$output" =~ "StartLimitIntervalUSec=0" "The hc service has the right interval set"

current_time=$(date --iso-8601=ns)
# After three successive failures, container should no longer be healthy
_check_health $ctrname "Four or more failures" "
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp