Merge lp:~soren/nova/eventlet-subprocess into lp:~hudson-openstack/nova/trunk

Proposed by Soren Hansen
Status: Merged
Approved by: Vish Ishaya
Approved revision: 671
Merged at revision: 674
Proposed branch: lp:~soren/nova/eventlet-subprocess
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 19 lines (+1/-1)
1 file modified
nova/utils.py (+1/-1)
To merge this branch: bzr merge lp:~soren/nova/eventlet-subprocess
Reviewer Review Type Date Requested Status
Vish Ishaya (community) Approve
Thierry Carrez (community) Approve
Jay Pipes (community) Approve
Review via email: mp+49698@code.launchpad.net

Commit message

Use eventlet.green.subprocess instead of standard subprocess

Description of the change

Use eventlet.green.subprocess instead of standard subprocess

Eventlet's monkey patching causes the os.wait call in the standard
subprocess module to be non-blocking. This means that if it happens
to call self.wait on a Popen object that hasn't completely terminated
it'll be left as a zombie and its fd's are also leaked.

Oh, there's an eventlet side to this, too, so your eventlet will need patching.

The eventlet.green.subprocess module is b0rken if the os module is monkey patched (which it is in Nova).

Patched packages are available in the trunk PPA for Lucid and Maverick or in Ubuntu proper for Natty. The details (and the patch) are here

https://bitbucket.org/which_linden/eventlet/issue/77/subprocess-module-fails-if-os-module-is

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

Well, that was easy :)

review: Approve
Revision history for this message
Thierry Carrez (ttx) wrote :

lgtm

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/utils.py'
2--- nova/utils.py 2011-02-09 19:18:48 +0000
3+++ nova/utils.py 2011-02-14 20:14:59 +0000
4@@ -25,7 +25,6 @@
5 import json
6 import os
7 import random
8-import subprocess
9 import socket
10 import struct
11 import sys
12@@ -36,6 +35,7 @@
13
14 from eventlet import event
15 from eventlet import greenthread
16+from eventlet.green import subprocess
17
18 from nova import exception
19 from nova.exception import ProcessExecutionError