Windows: exec calls are not greenthread friendly

Bug #1709586 reported by Lucian Petrut
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.concurrency
Fix Released
Undecided
Lucian Petrut

Bug Description

eventlet.green.subprocess is not actually greenthread friendly on Windows. It just uses the native subprocess.Popen in this case.

For this reason, exec calls do not yield on Windows, blocking other greenthreads.

This is especially troublesome for services running on Windows that perform long running exec calls (such as image conversions in case of Cinder).

Also, attempting to pass stdin data while using eventlet causes a deadlock. The reason is that in this situation, subprocess attempts to spawn two (green)threads consuming the stdout/stderr pipes, which are blocking on Windows.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.concurrency (master)

Fix proposed to branch: master
Review: https://review.openstack.org/492081

Changed in oslo.concurrency:
assignee: nobody → Lucian Petrut (petrutlucian94)
status: New → In Progress
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.concurrency (master)

Reviewed: https://review.openstack.org/492081
Committed: https://git.openstack.org/cgit/openstack/oslo.concurrency/commit/?id=3ac3c169ada2e1402ef9e71f0653af696a3d28af
Submitter: Jenkins
Branch: master

commit 3ac3c169ada2e1402ef9e71f0653af696a3d28af
Author: Lucian Petrut <email address hidden>
Date: Wed Aug 9 12:41:54 2017 +0300

    Windows: ensure exec calls don't block other greenthreads

    eventlet.green.subprocess is not actually greenthread friendly on
    Windows. It just uses the native subprocess.Popen in this case.

    For this reason, exec calls do not yield on Windows, blocking other
    greenthreads.

    This change avoids this issue by wrapping the 'communicate' call
    using eventlet.tpool.

    We're also ensuring that subprocess.Popen uses *native* threads
    internally in order to avoid deadlocks when passing data through
    stdin.

    Change-Id: Ic25fd1b61b5498f16e6049cbbe0877492f8aab4d
    Closes-Bug: #1709586

Changed in oslo.concurrency:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.concurrency (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/495192

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.concurrency 3.22.0

This issue was fixed in the openstack/oslo.concurrency 3.22.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.concurrency (stable/pike)

Reviewed: https://review.openstack.org/495192
Committed: https://git.openstack.org/cgit/openstack/oslo.concurrency/commit/?id=8adf9b1f0d69dca7372b967ef4f894487f1a9d64
Submitter: Jenkins
Branch: stable/pike

commit 8adf9b1f0d69dca7372b967ef4f894487f1a9d64
Author: Lucian Petrut <email address hidden>
Date: Wed Aug 9 12:41:54 2017 +0300

    Windows: ensure exec calls don't block other greenthreads

    eventlet.green.subprocess is not actually greenthread friendly on
    Windows. It just uses the native subprocess.Popen in this case.

    For this reason, exec calls do not yield on Windows, blocking other
    greenthreads.

    This change avoids this issue by wrapping the 'communicate' call
    using eventlet.tpool.

    We're also ensuring that subprocess.Popen uses *native* threads
    internally in order to avoid deadlocks when passing data through
    stdin.

    Change-Id: Ic25fd1b61b5498f16e6049cbbe0877492f8aab4d
    Closes-Bug: #1709586
    (cherry picked from commit 3ac3c169ada2e1402ef9e71f0653af696a3d28af)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.concurrency 3.21.1

This issue was fixed in the openstack/oslo.concurrency 3.21.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.