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
=== modified file 'nova/utils.py'
--- nova/utils.py 2011-02-09 19:18:48 +0000
+++ nova/utils.py 2011-02-14 20:14:59 +0000
@@ -25,7 +25,6 @@
25import json25import json
26import os26import os
27import random27import random
28import subprocess
29import socket28import socket
30import struct29import struct
31import sys30import sys
@@ -36,6 +35,7 @@
3635
37from eventlet import event36from eventlet import event
38from eventlet import greenthread37from eventlet import greenthread
38from eventlet.green import subprocess
3939
40from nova import exception40from nova import exception
41from nova.exception import ProcessExecutionError41from nova.exception import ProcessExecutionError