##// END OF EJS Templates
hook: ignore EPIPE when flushing stdout/stderr...
Mitchell Plamann -
r46329:b3e8d8e4 default
parent child Browse files
Show More
@@ -8,6 +8,7 b''
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import contextlib
10 import contextlib
11 import errno
11 import os
12 import os
12 import sys
13 import sys
13
14
@@ -289,10 +290,18 b' def redirect_stdio():'
289 # The stderr is fully buffered on Windows when connected to a pipe.
290 # The stderr is fully buffered on Windows when connected to a pipe.
290 # A forcible flush is required to make small stderr data in the
291 # A forcible flush is required to make small stderr data in the
291 # remote side available to the client immediately.
292 # remote side available to the client immediately.
292 procutil.stderr.flush()
293 try:
294 procutil.stderr.flush()
295 except IOError as err:
296 if err.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
297 raise error.StdioError(err)
293
298
294 if _redirect and oldstdout >= 0:
299 if _redirect and oldstdout >= 0:
295 procutil.stdout.flush() # write hook output to stderr fd
300 try:
301 procutil.stdout.flush() # write hook output to stderr fd
302 except IOError as err:
303 if err.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
304 raise error.StdioError(err)
296 os.dup2(oldstdout, stdoutno)
305 os.dup2(oldstdout, stdoutno)
297 os.close(oldstdout)
306 os.close(oldstdout)
298
307
@@ -64,4 +64,4 b' disconnecting. Then exit nonzero, to for'
64 abort: stream ended unexpectedly (got 0 bytes, expected 4)
64 abort: stream ended unexpectedly (got 0 bytes, expected 4)
65
65
66 $ check_for_abandoned_transaction
66 $ check_for_abandoned_transaction
67 Abandoned transaction!
67 [1]
General Comments 0
You need to be logged in to leave comments. Login now