mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-08-23 06:06:25 +00:00
The log buffer joins every buffered line and scans all of them for each pattern on every push, which is wasted work when a pattern cannot even match across lines. The buffer now caches the joined string, and Push invalidates the cache. CompilePattern marks the patterns that cannot match across lines (no start anchor, no way to match a newline, and the appended \z anchor binds every branch) and Match checks them against the most recent line alone.