Commit Graph
23 Commits
Author SHA1 Message Date
Ciprian Hacman a20306e6a1 fix(logwatchers/kmsg): don't close the old parser twice when Stop() interrupts a restart
The restart path closes the failed parser before retrying. If stopping
is signaled during the retry wait, watchLoop's deferred cleanup closed
the same parser again, logging a spurious 'file already closed' error
at shutdown. Clear the reference after closing and nil-check the defer.
2026-07-11 10:28:27 +03:00
Ciprian Hacman b77c1eb03f fix(logwatchers/kmsg): don't block Stop() when the log channel is full
The log monitor stops draining logCh before calling watcher.Stop(), so
with a full channel (e.g. a kmsg burst at shutdown) watchLoop blocked
on the send forever, never called tomb.Done(), and Stop() hung.
Select on tomb.Stopping() alongside the send.
2026-07-11 10:27:59 +03:00
Ciprian Hacman 187d4d30d6 fix(logwatchers/kmsg): rate-limit parser restarts to prevent hot loop
If the restarted parser's channel closes again right away (reads keep
failing on the reopened /dev/kmsg), the watcher restarts in a tight
loop with no delay, spinning a CPU core and flooding the logs
(measured 37k restarts in 200ms). Delay the first attempt when the
previous restart was less than retryDelay ago.
2026-07-11 10:27:37 +03:00
Ciprian Hacman 3d516d9213 test(logwatchers/kmsg): inject parser factory for testability and cover restart/stop 2026-04-11 08:37:32 +03:00
Kubernetes Prow RobotandGitHub ea22add87e Merge pull request #1259 from hakman/kmsg-duplicate-message
fix(logwatchers/kmsg): prevent duplicate message replay after restart
2026-04-11 00:18:18 +05:30
Ciprian Hacman b3379b0d23 fix(logwatchers/kmsg): prevent duplicate message replay after restart 2026-04-10 16:06:32 +03:00
Ciprian Hacman 78f76b2778 fix(logwatchers/kmsg): don't close parser from Stop()
Closing the parser in Stop() triggers kmsgparser's read goroutine to
close its output channel, which made watchLoop take the restart path
(added in #1192) during intentional shutdown. Leave parser cleanup to
watchLoop's defer, which is the single owner of the parser lifecycle.
2026-04-10 15:45:22 +03:00
Arjun Raman 748fecd95d Remove opt-in knob for restarting kmsg parser and simplify retry loop 2026-03-24 11:20:14 -07:00
Arjun RamanandGitHub c530d1f701 Remove log message for restart on error
Removed log message for disabled restart on error.
2025-12-18 12:29:26 -08:00
Arjun Raman f1bdf8d30e Restart kmsg on error 2025-12-11 15:51:24 -08:00
Ciprian Hacman 2e69489cc6 Update golangci-lint to v2.6.2 2025-11-29 10:42:18 +02:00
Sergey Kanzhelev 0ce333bbc5 enabled and fixed the errcheck linter rule 2025-09-10 21:45:46 +00:00
Sergey Kanzhelev 75bf501888 format imports 2025-08-13 16:56:32 +00:00
Ciprian Hacman 65e4aa3c5e Remove dependency on code.cloudfoundry.org/clock 2023-09-19 12:50:29 +03:00
Ciprian Hacman 5210373640 Init useful flags for klog/v2 2023-09-17 11:00:42 +03:00
Manuel RügerandCiprian Hacman e43459d86d Move glog/klog logging to klog/v2 2023-09-17 08:57:33 +03:00
Ciprian Hacman f58f6cd208 Update tests to run also on macOS 2023-09-11 19:25:59 +03:00
Jeremy Edwards 4adec4bbc6 Introduce Windows build of Node Problem Detector 2020-12-05 23:54:52 +00:00
Lantao Liu be7cc78aa0 Properly close channel when monitor exits.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-10-25 14:11:39 -07:00
Zhen Wang 1f636381b8 Detect kubelet and container runtime frequent crashes 2018-11-26 22:41:06 -08:00
Andy Xie 10dbfef1a8 add custom problem detector plugin 2017-11-22 10:14:09 +08:00
Random-Liu 51351f91b2 Cleanup kmsg log wather. 2017-05-30 15:58:45 -07:00
Euan Kemp 9c23921c11 logwatchers/kmsg: add initial kmsg watcher impl
This adds a logwatcher which is able to parse kernel messages directly
from the /dev/kmsg interface. This supports any modern linux distro,
while also avoiding any dependency on libraries (e.g. as journald
needs).
2017-03-09 20:40:49 -08:00