comparison mercurial/chgserver.py @ 49244:cd51d4957b28

branching: merge stable into default
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 02 Jun 2022 16:24:06 +0200
parents cf99c4af1079 201222849987
children c6a3243567b6
comparison
equal deleted inserted replaced
49239:a94f28be2e6e 49244:cd51d4957b28
444 # of EPIPE. The data should belong to the current session 444 # of EPIPE. The data should belong to the current session
445 # and should never persist. 445 # and should never persist.
446 os.dup2(nullfd, fp.fileno()) 446 os.dup2(nullfd, fp.fileno())
447 fp.flush() 447 fp.flush()
448 os.dup2(fd, fp.fileno()) 448 os.dup2(fd, fp.fileno())
449 os.close(fd)
449 except OSError as err: 450 except OSError as err:
450 # According to issue6330, running chg on heavy loaded systems 451 # According to issue6330, running chg on heavy loaded systems
451 # can lead to EBUSY. [man dup2] indicates that, on Linux, 452 # can lead to EBUSY. [man dup2] indicates that, on Linux,
452 # EBUSY comes from a race condition between open() and dup2(). 453 # EBUSY comes from a race condition between open() and dup2().
453 # However it's not clear why open() race occurred for 454 # However it's not clear why open() race occurred for
456 b'chgserver', 457 b'chgserver',
457 b'got %s while duplicating %s\n', 458 b'got %s while duplicating %s\n',
458 stringutil.forcebytestr(err), 459 stringutil.forcebytestr(err),
459 fn, 460 fn,
460 ) 461 )
461 os.close(fd)
462 setattr(self, cn, ch) 462 setattr(self, cn, ch)
463 setattr(ui, fn, fp) 463 setattr(ui, fn, fp)
464 os.close(nullfd) 464 os.close(nullfd)
465 del self._oldios[:] 465 del self._oldios[:]
466 466