From bd0d1306fd118f2095f99691fcbf086fd99b4f5e Mon Sep 17 00:00:00 2001 From: Max Arnold Date: Wed, 7 Feb 2024 06:40:42 -0600 Subject: [PATCH] Catch read_proc_file exceptions --- salt/utils/master.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/salt/utils/master.py b/salt/utils/master.py index 2c69117f3c2..9c4dbaa4724 100644 --- a/salt/utils/master.py +++ b/salt/utils/master.py @@ -64,7 +64,14 @@ def clean_proc_dir(opts): proc_dir = os.path.join(opts["cachedir"], "proc") for fn_ in os.listdir(proc_dir): proc_file = os.path.join(proc_dir, fn_) - data = _read_proc_file(proc_file, opts) + try: + data = _read_proc_file(proc_file, opts) + except OSError: + # proc files may be removed at any time during this process by + # the master process that is executing the JID in question, so + # we must ignore ENOENT during this process + log.trace("%s removed during processing by master process", proc_file) + continue if not data: try: log.warning(