Mercurial > public > mercurial-scm > hg
comparison mercurial/sshpeer.py @ 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 | 3dd3ccf7b807 |
comparison
equal
deleted
inserted
replaced
25407:e461230cc95b | 25408:c88975a4d264 |
---|---|
85 self.ui.debug('running %s\n' % cmd) | 85 self.ui.debug('running %s\n' % cmd) |
86 cmd = util.quotecommand(cmd) | 86 cmd = util.quotecommand(cmd) |
87 | 87 |
88 # while self.subprocess isn't used, having it allows the subprocess to | 88 # while self.subprocess isn't used, having it allows the subprocess to |
89 # to clean up correctly later | 89 # to clean up correctly later |
90 self.pipeo, self.pipei, self.pipee, self.subprocess = util.popen4(cmd) | 90 # |
91 # no buffer allow the use of 'select' | |
92 # feel free to remove buffering and select usage when we ultimately | |
93 # move to threading. | |
94 sub = util.popen4(cmd, bufsize=0) | |
95 self.pipeo, self.pipei, self.pipee, self.subprocess = sub | |
91 | 96 |
92 self.pipei = util.bufferedinputpipe(self.pipei) | 97 self.pipei = util.bufferedinputpipe(self.pipei) |
93 | 98 |
94 # skip any noise generated by remote shell | 99 # skip any noise generated by remote shell |
95 self._callstream("hello") | 100 self._callstream("hello") |