Commit Graph

6 Commits

Author SHA1 Message Date
Pierre-Yves David
4b634f00fc configitems: register the 'badserver.closebeforeaccept' config 2017-06-30 03:28:02 +02:00
Pierre-Yves David
8710067bec configitems: register the 'badserver.closeaftersendbytes' config 2017-06-30 03:27:54 +02:00
Pierre-Yves David
3e3867ca2c configitems: register the 'badserver.closeafterrecvbytes' config 2017-06-30 03:27:44 +02:00
Pierre-Yves David
9967b74e75 configitems: register the 'badserver.closeafteraccept' config 2017-06-30 03:27:36 +02:00
Matt Harbison
bc213046aa badserverext: explicitly flush each log write
No idea why, but without this, there was no content in the error logs that are
`cat`d in the test on Windows.
2017-04-16 21:25:16 -04:00
Gregory Szorc
9df2b10ec0 tests: add tests for poorly behaving HTTP server
I've spent several hours over the past few weeks investigating
networking failures involving hg.mozilla.org. As part of this, it
has become clear that the Mercurial client's error handling when
it encounters network failures is far from robust.

To prove this is true, I've devised a battery of tests simulating
various network failures, notably premature connection closes. To
achieve this, I've implemented an extension that monkeypatches the
built-in HTTP server and hooks in at the socket level and allows
various events to occur based on config options. For example, you
can refuse to accept() a client socket or you can close() the socket
after N bytes have been sent or received. The latter effectively
simulates an unexpected connection drop (and these occur all the
time in the real world).

The new test file launches servers exhibiting various "bad" behaviors
and points a client at them. As the many TODO comments in the test
call attention to, Mercurial often displays unhelpful errors when
network-related failures occur. This makes it difficult for users
to understand what's going on and difficult for server administrators
to pinpoint root causes without packet tracing.

Upcoming patches will attempt to fix these error handling
deficiencies.
2017-04-13 22:19:28 -07:00