##// END OF EJS Templates
chg: suppress OSError in _restoreio() and add some logging (issue6330)...
Pulkit Goyal -
r45580:3862de62 default
parent child Browse files
Show More
@@ -442,7 +442,20 b' class chgcmdserver(commandserver.server)'
442 if newfp is not fp:
442 if newfp is not fp:
443 newfp.close()
443 newfp.close()
444 # restore original fd: fp is open again
444 # restore original fd: fp is open again
445 os.dup2(fd, fp.fileno())
445 try:
446 os.dup2(fd, fp.fileno())
447 except OSError as err:
448 # According to issue6330, running chg on heavy loaded systems
449 # can lead to EBUSY. [man dup2] indicates that, on Linux,
450 # EBUSY comes from a race condition between open() and dup2().
451 # However it's not clear why open() race occurred for
452 # newfd=stdin/out/err.
453 self.ui.log(
454 b'chgserver',
455 b'got %s while duplicating %s\n',
456 stringutil.forcebytestr(err),
457 fn,
458 )
446 os.close(fd)
459 os.close(fd)
447 setattr(self, cn, ch)
460 setattr(self, cn, ch)
448 setattr(ui, fn, fp)
461 setattr(ui, fn, fp)
General Comments 0
You need to be logged in to leave comments. Login now