Skip to content

Commit f096bf2

Browse files
🐛 proc In process find, ignore processes that have stopped between listing and matching (#661)
<!-- Copyright (C) 2020-2022 Arm Limited or its affiliates and Contributors. All rights reserved. SPDX-License-Identifier: Apache-2.0 --> ### Description <!-- Please add any detail or context that would be useful to a reviewer. --> In process find, ignore processes that have stopped between listing and matching ### Test Coverage <!-- Please put an `x` in the correct box e.g. `[x]` to indicate the testing coverage of this change. --> - [ ] This change is covered by existing or additional automated tests. - [x] Manual testing has been performed (and evidence provided) as automated testing was not feasible. - [ ] Additional tests are not required for this change (e.g. documentation update).
1 parent e5ead81 commit f096bf2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

changes/20250730095330.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:bug: `proc` In process find, ignore processes that have stopped between listing and matching

utils/proc/find/find_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ func checkProcessMatch(ctx context.Context, fs filesystem.FS, re *regexp.Regexp,
2929

3030
data, err := fs.ReadFile(procEntry)
3131
if err != nil {
32-
if commonerrors.CorrespondTo(err, "no bytes were read") {
32+
if commonerrors.CorrespondTo(err, "no bytes were read", "no such file or directory") {
3333
err = nil
34-
return // ignore special descriptors since our cmdline will have content (we still have to check since all files in proc have size zero)
34+
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
3535
}
3636
err = commonerrors.WrapErrorf(commonerrors.ErrUnexpected, err, "could not read proc entry '%v'", procEntry)
3737
return

0 commit comments

Comments
 (0)