Fri, 14 Apr 2017 00:03:30 -0700 httppeer: eliminate decompressresponse() proxy
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 14 Apr 2017 00:03:30 -0700] rev 32003
httppeer: eliminate decompressresponse() proxy Now that the response instance itself is wrapped with error handling, we no longer need this code. This code became dead with the previous patch because the added code catches HTTPException and re-raises as something else.
Fri, 14 Apr 2017 00:33:56 -0700 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 14 Apr 2017 00:33:56 -0700] rev 32002
httppeer: wrap HTTPResponse.read() globally There were a handful of places in the code where HTTPResponse.read() was called with no explicit error handling or with inconsistent error handling. In order to eliminate this class of bug, we globally swap out HTTPResponse.read() with a unified error handler. I initially attempted to fix all call sites. However, after going down that rabbit hole, I figured it was best to just change read() to do what we want. This appears to be a worthwhile change, as the tests demonstrate many of our uncaught exceptions go away. To better represent this class of failure, we introduce a new error type. The main benefit over IOError is it can hold a hint. I'm receptive to tweaking its name or inheritance.
Thu, 13 Apr 2017 22:19:28 -0700 tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 13 Apr 2017 22:19:28 -0700] rev 32001
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.
Thu, 13 Apr 2017 22:12:04 -0700 phases: emit phases to pushkey protocol in deterministic order
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 13 Apr 2017 22:12:04 -0700] rev 32000
phases: emit phases to pushkey protocol in deterministic order An upcoming test will report exact bytes sent over the wire protocol. Without this change, the ordering of phases listkey data is non-deterministic.
Thu, 13 Apr 2017 18:04:38 -0700 keepalive: send HTTP request headers in a deterministic order
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 13 Apr 2017 18:04:38 -0700] rev 31999
keepalive: send HTTP request headers in a deterministic order An upcoming patch will add low-level testing of the bytes being sent over the wire. As part of developing that test, I discovered that the order of headers in HTTP requests wasn't deterministic. This patch makes the order deterministic to make things easier to test.
Sat, 15 Apr 2017 11:29:42 +0200 revset: properly parse "descend" argument of followlines()
Denis Laxalde <denis@laxalde.org> [Sat, 15 Apr 2017 11:29:42 +0200] rev 31998
revset: properly parse "descend" argument of followlines() We parse "descend" symbol as a Boolean using getboolean (prior extraction by getargsdict already checked that it is a symbol). In tests, check for error cases and vary Boolean values here and there.
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -6 +6 +10 +30 +100 +300 +1000 +3000 +10000 tip