zuul/zuul/executor
Simon Westphahl e02963f6e1 Replace preexec_fn argument in executor popen call
According to the Python documentation the preexec_fn argument is not
thread-safe and can cause a deadlock in the child process.

The use of preexec_fn=os.setsid can be avoided by using
start_new_session=True in the popen() call which is available in Python
>= 3.2

DEBUG zuul.stack_dump: Thread: 139775071643392 build-e584032fcc424259be5b0feddfc3f0b4 d: True
  File "/usr/lib/python3.6/threading.py", line 884, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/zuul/lib/python3.6/site-packages/zuul/executor/server.py", line 931, in execute
    self._execute()
  File "/opt/zuul/lib/python3.6/site-packages/zuul/executor/server.py", line 1154, in _execute
    result = self.runPlaybooks(args)
  File "/opt/zuul/lib/python3.6/site-packages/zuul/executor/server.py", line 1437, in runPlaybooks
    phase='post', index=index)
  File "/opt/zuul/lib/python3.6/site-packages/zuul/executor/server.py", line 2464, in runAnsiblePlaybook
    cleanup=phase == 'cleanup')
  File "/opt/zuul/lib/python3.6/site-packages/zuul/executor/server.py", line 2210, in runAnsible
    env=env_copy,
  File "/opt/zuul/lib/python3.6/site-packages/zuul/driver/bubblewrap/__init__.py", line 55, in __call__
    proc = psutil.Popen(args, *sub_args, **kwargs)
  File "/opt/zuul/lib/python3.6/site-packages/psutil/__init__.py", line 1322, in __init__
    self.__subproc = subprocess.Popen(*args, **kwargs)
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1318, in _execute_child
    part = os.read(errpipe_read, 50000)

Change-Id: I0b5110e0b29025f9bb121be26a678fcbe130ba73
2020-05-12 09:42:05 +02:00
..
sensors Enable starting executors in paused mode 2019-11-04 13:13:38 +01:00
__init__.py Rename zuul-launcher to zuul-executor 2017-03-15 12:21:24 -04:00
client.py Add Zuul's event id to Ansible inventory 2020-02-06 11:32:48 +01:00
server.py Replace preexec_fn argument in executor popen call 2020-05-12 09:42:05 +02:00