Socket timeout
Augie Fackler
raf at durin42.com
Wed Oct 3 15:52:38 UTC 2018
> On Sep 29, 2018, at 05:32, Cédric Krier <cedric.krier at b2ck.com> wrote:
>
> 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.
I might be inclined to do this as a context manager in httppeer or some lower layer, so we can restore it when done, just to avoid as many surprises as possible.
But dispatch might be fine too.
>
>
> [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/
More information about the Mercurial
mailing list