Browse Source

Use oslo_rootwrap subprocess module in order to gain proper eventlet awareness

Via 31cfdbd407
oslo.rootwrap gained support eventlet when using subprocess. By moving
to oslo_rootwrap.subprocess we make sure that with python3 the
subprocess calls use eventlet.green.subprocess if eventlet is used.
This worked on python2 because (from above commit):
"""
On Python 2, it "works" to use directly subprocess: subprocess.Popen
calls os.pipe() and os.fdopen(fd) which are both monkey-patched. On
Python 3, it doesn't work because subprocess uses os.pipe() and
io.open(fd), and the io module is *not* monkey-patched at all.
"""

By applying this change what happens is that the heartbeat thread is
able to be scheduled every 15seconds by default. Without this patch
what we have been observing with python3 is that while running ansible
mistral would constantly log error messages like the following:
2019-05-02 19:14:36.702 8 WARNING oslo.messaging._drivers.impl_rabbit [-] Unexpected error during heartbeart thread processing, retrying...: amqp.exceptions.ConnectionForced: Too many heartbeats missed

With this change we could not reproduce this issue during a deployment
and no missed heartbeat messages were observed during the deploy.

Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>
Co-Authored-By: Hervé Beraud <hberaud@redhat.com>

Closes-Bug: #1826281

Change-Id: Id22b1465d6d2424d90781983b970aba4545feb8a
(cherry picked from commit 2e54cff0db)
changes/90/657090/1
Michele Baldessari 2 years ago
parent
commit
6f55c89171
  1. 1
      lower-constraints.txt
  2. 1
      requirements.txt
  3. 2
      tripleo_common/actions/ansible.py

1
lower-constraints.txt

@ -56,6 +56,7 @@ oslo.config==5.2.0
oslo.context==2.19.2
oslo.i18n==3.15.3
oslo.log==3.36.0
oslo.rootwrap==5.8.0
oslo.serialization==2.18.0
oslo.utils==3.33.0
oslotest==3.2.0

1
requirements.txt

@ -9,6 +9,7 @@ eventlet!=0.20.1,>=0.20.0 # MIT
python-heatclient>=1.10.0 # Apache-2.0
oslo.config>=5.2.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0
oslo.rootwrap>=5.8.0 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0
python-glanceclient>=2.8.0 # Apache-2.0
python-ironicclient>=2.3.0 # Apache-2.0

2
tripleo_common/actions/ansible.py

@ -20,7 +20,6 @@ import shutil
import six
from six.moves import configparser
from six.moves import cStringIO as StringIO
import subprocess
import sys
import tempfile
import time
@ -28,6 +27,7 @@ import yaml
from mistral_lib import actions
from oslo_concurrency import processutils
from oslo_rootwrap import subprocess
from tripleo_common.actions import base
from tripleo_common import inventory

Loading…
Cancel
Save