Change in vdsm[master]: kill and report asyncProc if fails on first write to stdin
ybronhei at redhat.com
ybronhei at redhat.com
Wed Jan 13 07:58:30 UTC 2016
Yaniv Bronhaim has uploaded a new change for review.
Change subject: kill and report asyncProc if fails on first write to stdin
......................................................................
kill and report asyncProc if fails on first write to stdin
Change-Id: I57b68742ce1dcae1d9fdad020b7b4a41ca6ad028
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
---
M lib/vdsm/commands.py
1 file changed, 12 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/51763/1
diff --git a/lib/vdsm/commands.py b/lib/vdsm/commands.py
index c57e937..5ac7cba 100644
--- a/lib/vdsm/commands.py
+++ b/lib/vdsm/commands.py
@@ -27,6 +27,8 @@
import os
import select
import signal
+import six
+import sys
import threading
import time
from . import cmdutils
@@ -71,8 +73,16 @@
if not sync:
p = AsyncProc(p)
if data is not None:
- p.stdin.write(data)
- p.stdin.flush()
+ try:
+ p.stdin.write(data)
+ p.stdin.flush()
+ except:
+ exc_info = sys.exc_info()
+ try:
+ p.kill()
+ except Exception:
+ execCmdLogger.error("Process %n failed to die" % p.pid)
+ six.reraise(*exc_info)
return p
--
To view, visit https://gerrit.ovirt.org/51763
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I57b68742ce1dcae1d9fdad020b7b4a41ca6ad028
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
More information about the vdsm-patches
mailing list