Use oslo_rootwrap subprocess module in order to gain proper eventlet awareness
Via https://github.com/openstack/oslo.rootwrap/commit/31cfdbd4076bb6556cf9612171ba43fa44475d71
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.
Reviewed: https:/ /review. opendev. org/656901 /git.openstack. org/cgit/ openstack/ tripleo- common/ commit/ ?id=2e54cff0db2 13494d07c72ce0f 36d60831d2e84d
Committed: https:/
Submitter: Zuul
Branch: master
commit 2e54cff0db21349 4d07c72ce0f36d6 0831d2e84d
Author: Michele Baldessari <email address hidden>
Date: Thu May 2 23:20:48 2019 +0200
Use oslo_rootwrap subprocess module in order to gain proper eventlet awareness
Via https:/ /github. com/openstack/ oslo.rootwrap/ commit/ 31cfdbd4076bb65 56cf9612171ba43 fa44475d71 subprocess we make sure that with python3 the green.subproces s if eventlet is used.
oslo.rootwrap gained support eventlet when using subprocess. By moving
to oslo_rootwrap.
subprocess calls use eventlet.
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 _drivers. impl_rabbit [-] Unexpected error during heartbeart thread processing, retrying...: amqp.exceptions .ConnectionForc ed: Too many heartbeats missed
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.
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 <email address hidden>
Co-Authored-By: Hervé Beraud <email address hidden>
Closes-Bug: #1826281
Change-Id: Id22b1465d6d242 4d90781983b970a ba4545feb8a