plugins/xenserver/networking/etc/xensource/scripts/novalib.py uses subprocess incorrectly

Bug #1286187 reported by Johannes Erdfelt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned

Bug Description

Both execute_get_output() and execute() don't wait until the process is finished running.

execute_get_output() probably hasn't caused a problem since it at least does one read and the commands it runs likely would finish (but this isn't guaranteed).

execute() sets up a PIPE for the process stdout, but doesn't do any reads before returning to the caller. This could make the code execute multiple processes in parallel leading to a race condition that could cause commands to execute in the opposite order that is intended. It could potentially also cause the process to block on writes to the PIPE that isn't being read leading it to never finish executing.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/77198
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=27c80860280ca5f7983d207cdbfd217ac1a2d68d
Submitter: Jenkins
Branch: master

commit 27c80860280ca5f7983d207cdbfd217ac1a2d68d
Author: Johannes Erdfelt <email address hidden>
Date: Fri Feb 28 15:35:34 2014 +0000

    xenapi plugins: Make sure subprocesses finish executing

    Fixes bug 1286187

    Neither execute_get_output() nor execute() would wait for the process to
    fully finish executing. This could potentially create a race condition
    where commands execute in a different order than intended.

    Also, for execute() it could cause a process to never finish executing if
    it generates enough output to block writing to the pipe.

    Change-Id: I3404f4b3ca1cddeec2f3e7b393817a6ccc42bec7

Changed in nova:
status: New → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-3 → 2014.1
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.