Nir Soffer has uploaded a new change for review.

Change subject: testlib: Use osutils.close_fd to avoid fd leaks
......................................................................

testlib: Use osutils.close_fd to avoid fd leaks

If a child process exit when we close a file descriptor, the call may be
interrupted, and we would not close the next fd.

Change-Id: I5c8d2b7e29cc7df751d4fc1954ad3f3cae6917ce
Signed-off-by: Nir Soffer <[email protected]>
---
M tests/testlib.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/61216/1

diff --git a/tests/testlib.py b/tests/testlib.py
index aa44737..0246b17 100644
--- a/tests/testlib.py
+++ b/tests/testlib.py
@@ -50,6 +50,8 @@
 
 import vdsm
 
+from vdsm.common import osutils
+
 from monkeypatch import Patch
 from testValidation import SlowTestsPlugin, StressTestsPlugin
 
@@ -519,8 +521,8 @@
                     e = pickle.loads(os.read(r, 4006))
                     raise e
         finally:
-            os.close(r)
-            os.close(w)
+            osutils.close_fd(r)
+            osutils.close_fd(w)
 
     return wrapper
 


-- 
To view, visit https://gerrit.ovirt.org/61216
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c8d2b7e29cc7df751d4fc1954ad3f3cae6917ce
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/admin/lists/[email protected]

Reply via email to