Socket timeout

Cédric Krier cedric.krier at b2ck.com
Sat Sep 29 09:32:23 UTC 2018


On 2018-09-24 08:42, Augie Fackler wrote:
> (+greg who's been in our network code a lot recently)
> 
> > On Sep 24, 2018, at 05:34, Cédric Krier via Mercurial <mercurial at mercurial-scm.org> wrote:
> > 
> > On 2018-09-24 09:11, Anton Shestakov wrote:
> >>> But could someone confirm how the socket
> >>> timeout or server hanging are managed in mercurial?
> >> 
> >> That depends on your server setup. There are many ways to set up
> >> hgweb, e.g. front server (apache httpd, nginx, lighttpd) and upstream
> >> (uwsgi, gunicorn) or server module (mod_wsgi, mod_scgi), and most of
> >> them manage sockets by their own logic.
> > 
> > My setup is using lighttpd with fcgi (using spawn-fcgi).
> > 
> > But the question is more related on the client side. After how long does
> > the mercurial client stop waiting answers and raise a timeout error? Is
> > it possible to configure such timeout.
> 
> Greg, have you observed anyplace we could configure some global timeouts like this user is requesting? It sounds reasonable to me...

I made some test and indeed there is no timeout when using HTTP
protocol.
As far as I can see, HTTP connections are made with the standard library
httplib.HTTPConnection [1]. If no timeout is given which seems to be the
case, the global default timeout is used [2] and it is None by default.
So I think it will be good to have a configuration to set the default
timeout in dispatch.py. If you agree on this, I can work on a patch.


[1] https://docs.python.org/2.7/library/httplib.html#httplib.HTTPConnection
[2] https://docs.python.org/2.7/library/socket.html#socket.getdefaulttimeout
-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.krier at b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 376 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20180929/458bbf40/attachment.asc>


More information about the Mercurial mailing list