Mercurial > public > mercurial-scm > hg
comparison mercurial/wireproto.py @ 36991:d683c7367989
wireproto: explicitly flush stdio to prevent stalls on Windows
This is the key to fixing the hangs on Windows in D2720[1]. I put flushes in a
bunch of other places that didn't help, but I suspect that's more a lack of test
coverage than anything else.
Chasing down stuff like this is pretty painful. I'm wondering if we can put a
proxy around sys.stderr (and sys.stdout?) on Windows (only when daemonized?)
that will flush on every write (or at least every write with a '\n').
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-March/113352.html
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 10 Mar 2018 23:58:01 -0500 |
parents | 4901d1e22b27 |
children | cd0ca979a8b8 |
comparison
equal
deleted
inserted
replaced
36990:b6a4881cec19 | 36991:d683c7367989 |
---|---|
1075 # This need to be moved to something proper. | 1075 # This need to be moved to something proper. |
1076 # Feel free to do it. | 1076 # Feel free to do it. |
1077 util.stderr.write("abort: %s\n" % exc) | 1077 util.stderr.write("abort: %s\n" % exc) |
1078 if exc.hint is not None: | 1078 if exc.hint is not None: |
1079 util.stderr.write("(%s)\n" % exc.hint) | 1079 util.stderr.write("(%s)\n" % exc.hint) |
1080 util.stderr.flush() | |
1080 return pushres(0, output.getvalue() if output else '') | 1081 return pushres(0, output.getvalue() if output else '') |
1081 except error.PushRaced: | 1082 except error.PushRaced: |
1082 return pusherr(pycompat.bytestr(exc), | 1083 return pusherr(pycompat.bytestr(exc), |
1083 output.getvalue() if output else '') | 1084 output.getvalue() if output else '') |
1084 | 1085 |