Mercurial > hg-stable
changeset 48878:201222849987 stable
chg: ignore already closed fds when cleaning up
This should fix this error we see in the CI from time to time:
```
--- /tmp/mercurial-ci/tests/test-chg.t
+++ /tmp/mercurial-ci/tests/test-chg.t.err
@@ -187,6 +187,26 @@
$ chg bulkwrite --pager=on --color no --config ui.formatted=True
paged! 'going to write massive data\n'
killed! (?)
+ Traceback (most recent call last):
+ File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/commandserver.py", line 509, in _serverequest
+ sv.cleanup()
+ File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/chgserver.py", line 382, in cleanup
+ self._restoreio()
+ File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/chgserver.py", line 461, in _restoreio
+ os.close(fd)
+ OSError: [Errno 9] Bad file descriptor
+ Traceback (most recent call last):
+ File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/commandserver.py", line 693, in _acceptnewconnection
+ self._runworker(conn)
+ File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/commandserver.py", line 744, in _runworker
+ prereposetups=[self._reposetup],
+ File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/commandserver.py", line 509, in _serverequest
+ sv.cleanup()
+ File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/chgserver.py", line 382, in cleanup
+ self._restoreio()
+ File "/tmp/hgtests._uvojvqb/install/lib/python/mercurial/chgserver.py", line 461, in _restoreio
+ os.close(fd)
+ OSError: [Errno 9] Bad file descriptor
[255]
```
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Mon, 30 May 2022 11:52:31 +0200 |
parents | 9dad328434c7 |
children | 6b10151b9621 |
files | mercurial/chgserver.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/chgserver.py Sun May 29 14:44:19 2022 +0200 +++ b/mercurial/chgserver.py Mon May 30 11:52:31 2022 +0200 @@ -465,6 +465,7 @@ os.dup2(nullfd, fp.fileno()) fp.flush() os.dup2(fd, fp.fileno()) + os.close(fd) except OSError as err: # According to issue6330, running chg on heavy loaded systems # can lead to EBUSY. [man dup2] indicates that, on Linux, @@ -477,7 +478,6 @@ stringutil.forcebytestr(err), fn, ) - os.close(fd) setattr(self, cn, ch) setattr(ui, fn, fp) os.close(nullfd)