Patchwork D10073: sshpeer: don't fail forwarding output from closed connections

login
register
mail settings
Submitter phabricator
Date Feb. 25, 2021, 3:37 p.m.
Message ID <differential-rev-PHID-DREV-fymwjmpncjjb4suvjdol-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48388/
State Superseded
Headers show

Comments

phabricator - Feb. 25, 2021, 3:37 p.m.
valentin.gatienbaron created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The test still shows an internal error, but one that happens
  further along.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10073

AFFECTED FILES
  mercurial/sshpeer.py
  tests/test-ssh-batch.t

CHANGE DETAILS




To: valentin.gatienbaron, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-ssh-batch.t b/tests/test-ssh-batch.t
--- a/tests/test-ssh-batch.t
+++ b/tests/test-ssh-batch.t
@@ -10,4 +10,4 @@ 
 further lookups don't result in tracebacks.
 
   $ hg pull -r b0 -r nosuchbookmark $(for i in $($TESTDIR/seq.py 1 20); do echo -r b$i; done) -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/$(pwd)/../a |& tail -n 1
-  ValueError: I/O operation on closed file
+  StopIteration
diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -40,7 +40,7 @@ 
     """display all data currently available on pipe as remote output.
 
     This is non blocking."""
-    if pipe:
+    if pipe and not pipe.closed:
         s = procutil.readpipe(pipe)
         if s:
             display = ui.warn if warn else ui.status