[PATCH 1 of 5] tests: Fix test-push-http by adding workaround for missing shutdown in SocketServer.TCPServer.close_request

Matt Mackall mpm at selenic.com
Mon Oct 6 15:17:17 CDT 2008


On Mon, 2008-10-06 at 15:01 +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <mads at kiilerich.com>
> # Date 1223296881 -7200
> # Node ID dc1af045f7197d24e54ad58caafbd43a4f078826
> # Parent  582dac23ebacc3ed48a1e5018af5f6476ac433f7
> tests: Fix test-push-http by adding workaround for missing shutdown in SocketServer.TCPServer.close_request
> 
> Mercurial server sends an error code as data and closes the http connection.
> TCPServer send()s valid data and then calls socket.close(). On some OSs (for
> example Linux) that might cause a RST to be sent while valid data were pending.
> That would cause recv() to fail without getting the real data.
> 
> RFC:
> Is this analysis correct?
> Do Mercurial use TCPServer correctly?
> Is this a real bug in python stdlib? (but Mercurial has to workaround it for years anyway...)
> Should be workarounded somehow else?

Sounds iffy. If this is actually the case, we should root-cause it. How
did you go about analyzing this? Can you reproduce it with a minimal
Python HTTPServer or socket app?

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list