mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't use os.wait() on subprocesses managed by multiprocessing
.
See #35480 for details.
This commit is contained in:
parent
e0baf4b193
commit
b6937ebaa8
1 changed files with 5 additions and 12 deletions
|
@ -378,19 +378,12 @@ class ProcessManager(object):
|
|||
try:
|
||||
# in case someone died while we were waiting...
|
||||
self.check_children()
|
||||
|
||||
if not salt.utils.is_windows() and not async:
|
||||
pid, exit_status = os.wait()
|
||||
if pid not in self._process_map:
|
||||
log.debug('Process of pid {0} died, not a known'
|
||||
' process, will not restart'.format(pid))
|
||||
continue
|
||||
if self._restart_processes is True:
|
||||
self.restart_process(pid)
|
||||
elif async is True:
|
||||
# The event-based subprocesses management code was removed from here
|
||||
# because os.wait() conflicts with the subprocesses management logic
|
||||
# implemented in `multiprocessing` package. See #35480 for details.
|
||||
if async:
|
||||
yield gen.sleep(10)
|
||||
elif async is False:
|
||||
# os.wait() is not supported on Windows.
|
||||
else:
|
||||
time.sleep(10)
|
||||
# OSError is raised if a signal handler is called (SIGTERM) during os.wait
|
||||
except OSError:
|
||||
|
|
Loading…
Add table
Reference in a new issue