-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix systemd watchdog feature #1525
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @guilhem ✋ !
Few comments :) But thanks for this !
cmd/traefik/traefik.go
Outdated
if err != nil { | ||
log.Error("Problem with watchdog", err) | ||
} else if t != 0 { | ||
// Send a ping each half time given | ||
t = t / 2 | ||
log.Info("Watchdog activated with timer each ", t) | ||
go func(interval time.Duration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to avoid panic, could you use safe.Go
to launch the go routine here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
cmd/traefik/traefik.go
Outdated
go func(interval time.Duration) { | ||
tick := time.Tick(interval) | ||
for range tick { | ||
daemon.SdNotify(true, "WATCHDOG=1") | ||
if ok, _ := daemon.SdNotify(false, "WATCHDOG=1"); ok { | ||
log.Debug("Tick watchdog") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we log on error instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @guilhem
LGTM
Commit coreos/go-systemd@0c088e introduce cleaning environment. First usage of sdnotify (for type=notify) was clearing NOTIFY_SOCKET environment variable. sdnotify in watchdog was unable to ping back. Fix #1353
Commit coreos/go-systemd@0c088e introduce cleaning environment.
First usage of sdnotify (for type=notify) was clearing NOTIFY_SOCKET environment variable.
sdnotify in watchdog was unable to ping back.
Fix #1353