This is an archive of the discontinued Mercurial Phabricator instance.

server: always close http socket if responding with an error (issue6033)
ClosedPublic

Authored by durin42 on Jan 6 2019, 3:28 PM.

Details

Summary

It's possible for hgweb to respond _very_ early with an error if we're
catching certain types of errors. When we do, we need to tell the client
the socket is toast when there's a POST involved because otherwise there
can be lingering POST data on the socket that will confuse any future
requests on the socket. This manifested as a flaky failure on Linux in an
lfs extension test and a reliable failure on FreeBSD. With this patch
applied, test-lfs-serve-access.t now passes for me on FreeBSD.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durin42 created this revision.Jan 6 2019, 3:28 PM
mharbison72 accepted this revision.Jan 6 2019, 11:16 PM
mharbison72 added a subscriber: mharbison72.

This works for me on Windows in that narrow window where this was constantly happening, thanks!

pulkit accepted this revision.Jan 7 2019, 5:24 AM
pulkit added a comment.Jan 7 2019, 5:27 AM

Is this meant for stable?

In D5498#81525, @pulkit wrote:

Is this meant for stable?

It'd be fine on stable if it applies cleanly there, but it's only /needed/ on default: the tests are exposing what is, frankly, a theoretical problem that extant versions of hg clients won't ever trigger in the wild.

This revision was automatically updated to reflect the committed changes.