changeset 25408:c88975a4d264

sshpeer: run the ssh command unbuffered This is necessary to use non-blocking IO base on polling. Such polling is needed to restore real time output with ssh peer. Changeset fce065538bcf is talking about 5x regression on Mac OS X when playing with this value. So we introduced our own buffering layer in previous changesets. This seems to keep the regression away (we are even issuing much less read).
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 20 May 2015 11:31:38 -0500
parents e461230cc95b
children 95e042d77a5f
files mercurial/sshpeer.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/sshpeer.py	Sun May 31 00:00:36 2015 -0700
+++ b/mercurial/sshpeer.py	Wed May 20 11:31:38 2015 -0500
@@ -87,7 +87,12 @@
 
         # while self.subprocess isn't used, having it allows the subprocess to
         # to clean up correctly later
-        self.pipeo, self.pipei, self.pipee, self.subprocess = util.popen4(cmd)
+        #
+        # no buffer allow the use of 'select'
+        # feel free to remove buffering and select usage when we ultimately
+        # move to threading.
+        sub = util.popen4(cmd, bufsize=0)
+        self.pipeo, self.pipei, self.pipee, self.subprocess = sub
 
         self.pipei = util.bufferedinputpipe(self.pipei)