Increasing the Apache TimeOut to fix a failing push due to a gateway timeout

Angel Ezquerra angel.ezquerra at gmail.com
Tue Sep 4 05:24:54 UTC 2012


Hi,

a colleague of mine had trouble pushing to one of the repositories in
our central mercurial web server. His push included a revision that
added a lot of files, some of them in the order of 100 MB. The total
size of the revision was around 500 MB.

When he tried to push the push failed after a while with a "gateway
timeout" message. When this happened the central repo would get
"broken" since there would be an interrupted transaction which must
had to be rolled back.

The server is a Windows 2003 x64 machine running Apache 2.2 with
mercurial configured as CGI. On the Apache error.log file I saw the
following error:

   [Mon Sep 03 13:41:36 2012] [error] [client 192.168.40.67] Script
timed out before returning headers: hgweb.cgi

where 192.168.40.67 is my colleague's internal IP address.

So it seems that it takes a long time for mercurial to get finish the
push and the results on a timeout. Apparently Apache's default timeout
for any operation is 300 seconds and the push takes way longer than
that.

To fix the issue I have set the apache TimeOut to 1200 on the Apache
httpd.conf file. This seems to work but I am unsure whether this may
have some unintended consequences. Is this the right way to fix this?

Another thing that I find surprising is that the progress that is
shown by hg push increases until it got to 50.01% and then it stops.
Then it stays there for a quite long time until it times out. The same
happens after I change the apache TimeOut setting, except that now the
push finishes fine (but it never shows a progress above 50.01%). Is
that normal?

Cheers,

Angel



More information about the Mercurial mailing list