From: Niklas Hambuechen <[email protected]>

When the forked (Python) job process dies for any reason, then the next `read`
from its pipe will fail, giving an unhelpful error like:

   GenericError "<file descriptor: 13>: hWaitForInput: end of file"

This commit adds an error log message when reading or writing the
pipe fails.

Signed-off-by: Niklas Hambuechen <[email protected]>
Reviewed-by: Hrvoje Ribicic <[email protected]>
Signed-off-by: Klaus Aehlig <[email protected]>

Conflicts:
        src/Ganeti/Query/Exec.hs - merge changes from both branches

Cherry-picked-from: 208c6166d9176e36495ce3d8dff9a649662e72f5
Signed-off-by: Petr Pudlak <[email protected]>
---
 src/Ganeti/Query/Exec.hs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/Ganeti/Query/Exec.hs b/src/Ganeti/Query/Exec.hs
index 73ae68c..23830ca 100644
--- a/src/Ganeti/Query/Exec.hs
+++ b/src/Ganeti/Query/Exec.hs
@@ -249,7 +249,13 @@ forkJobProcess jid luxiLivelock update = do
       . (`mplus` (onError >> mzero))
       $ do
       let recv = liftIO $ recvMsg master
-          send = liftIO . sendMsg master
+                   `onException`
+                   logError "recv from ganeti job process pipe failed"
+
+          send x = liftIO $ sendMsg master x
+                     `onException`
+                     logError "send to ganeti job process pipe failed"
+
       logDebugJob "Getting the lockfile of the client"
       lockfile <- recv `orElse` mzero
 
-- 
2.2.0.rc0.207.ga3a616c

Reply via email to