diff --git a/changes/20250730095330.bugfix b/changes/20250730095330.bugfix new file mode 100644 index 0000000000..1f8c8bcf96 --- /dev/null +++ b/changes/20250730095330.bugfix @@ -0,0 +1 @@ +:bug: `proc` In process find, ignore processes that have stopped between listing and matching diff --git a/utils/proc/find/find_linux.go b/utils/proc/find/find_linux.go index 23667a9ef7..8490f8b589 100644 --- a/utils/proc/find/find_linux.go +++ b/utils/proc/find/find_linux.go @@ -29,9 +29,9 @@ func checkProcessMatch(ctx context.Context, fs filesystem.FS, re *regexp.Regexp, data, err := fs.ReadFile(procEntry) if err != nil { - if commonerrors.CorrespondTo(err, "no bytes were read") { + if commonerrors.CorrespondTo(err, "no bytes were read", "no such file or directory") { err = nil - return // ignore special descriptors since our cmdline will have content (we still have to check since all files in proc have size zero) + return // ignore special descriptors since our cmdline will have content (we still have to check since all files in proc have size zero) as well as processes that have stopped since the listing occurred } err = commonerrors.WrapErrorf(commonerrors.ErrUnexpected, err, "could not read proc entry '%v'", procEntry) return