[PATCH] Make sure whole bundle content is read before replying to web unbundle command

Matt Mackall mpm at selenic.com
Tue Oct 14 15:29:15 CDT 2008


On Tue, 2008-10-14 at 21:06 +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <mads at kiilerich.com>
> # Date 1224011135 -7200
> # Node ID 4e1bd3d919018096a644c4e821531d80898b755b
> # Parent  0ed11838bd1a5102ce7ed7835754dfcf1322168d
> Make sure whole bundle content is read before replying to web unbundle command.
> 
> The hg client is "half duplex" and expects to be able to send the whole content
> before reading response with error messages, so the server should eat all
> content before sending error response. It is only the unbundle command that
> uploads content, so the problem is only seen there.
> 
> This fixes spurious failure of test-push-http where hg pull got 'abort: push failed:
> Connection reset by peer' or 'Software caused connection abort' instead of 'ssl
> required'. On one system it fails 25% of the times, on another it never fails
> ...
> 
> I can reproduce the problem quite consistently with hg clone -f of the hg repo
> to an empty repo on a linux server. But I don't know how to make a test of this.
> 
> Note: This change will allow unauthorized users to use bandwith with one TCP
> connection. But they can do it anyway by using several connections, so I don't
> consider that important.

Interesting. How much harder would it be to make the client handle the
exception instead? We'd much rather take load off the server side.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list