D2720: debugcommands: introduce actions to perform deterministic reads
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Fri Mar 9 14:39:16 EST 2018
mharbison72 added a comment.
In https://phab.mercurial-scm.org/D2720#44350, @indygreg wrote:
> In https://phab.mercurial-scm.org/D2720#44293, @mharbison72 wrote:
>
> > i> write(4) -> 4:
> > i> 426\n
> > i> write(426) -> 426:
> > i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x0
> > 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
> > x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
> > x00>cba485ca3678256e044428f70f58291196f6e9de\n
> > i> test\n
> > i> 0 0\n
> > i> foo\n
> > i> \n
> > i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00
> > \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
> > 00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x
> > 00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
> > i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xa
> > f\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
> > \x00\x00\x00\x00\x00\x00\x00\x00\
> >
> >
>
>
> This is a wonky place to hang! For context, this is processing a `command unbundle` line. The lines that follow should be:
>
> i> write(2) -> 2:
> i> 0\n
> i> flush() -> None
> o> readline() -> 2:
> o> 0\n
> o> readline() -> 2:
> o> 1\n
> o> read(1) -> 1: 0
> result: 0
> remote output:
> e> read(115) -> 115:
> e> abort: incompatible Mercurial client; bundle2 required\n
> e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n
>
>
> What happens under the hood during pushes is we send out chunks containing the bundle followed by an empty chunk. That code is:
>
> for d in iter(lambda: fp.read(4096), ''):
> self._writeframed(d)
> self._writeframed("", flush=True)
>
>
> That empty chunk is apparently not getting sent. Or its logging is not getting written/printed.
>
> This patch shouldn't have changed any behavior with regard to this part of the I/O. So I'm scratching my head over how this caused deadlock. Are you sure you can bisect it to this patch.
Yep. I imported this with `hg phapread --stack`, and can run the https://phab.mercurial-scm.org/D2719 in 50 seconds or so. The debug run of this I let hang out for 20 minutes before killing it.
Here's the neighboring failure from https://phab.mercurial-scm.org/D2719, because I can't explain the AWOL output. (But that shouldn't have stopped stdout above mid stream.)
--- e:/Projects/hg/tests/test-ssh-proto-unbundle.t
+++ e:/Projects/hg/tests/test-ssh-proto-unbundle.t.err
@@ -93,9 +93,6 @@
o> read(1) -> 1: 0
result: 0
remote output:
- e> read(-1) -> 115:
- e> abort: incompatible Mercurial client; bundle2 required\n
- e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n
testing ssh2
creating ssh peer from handshake results
@@ -143,9 +140,6 @@
o> read(1) -> 1: 0
result: 0
remote output:
- e> read(-1) -> 115:
- e> abort: incompatible Mercurial client; bundle2 required\n
- e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n
$ cd ..
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2720
To: indygreg, #hg-reviewers
Cc: mharbison72, mercurial-devel
More information about the Mercurial-devel
mailing list