From ecc093033da62a6fd005081274d01090591579cd Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 4 Jul 2017 11:18:48 +0200 Subject: [PATCH] [FIX] service.server: bump up socket timeout to 2s Rev. 8245c1d1d87b443701b161d8d4a42df2b4d13aec introduced a timeout to avoid lockup situations with wkhtmltopdf's requests on servers with low numbers of free HTTP workers. The initial timeout of 500ms was chosen based on average network latency, but turned out to cause spurious disconnections on congested networks combined with slow links. Bumping up the timeout to 2s seems to be a better sweet spot, causing less spurious disconnections while still recovering reasonably fast from the wkhtmltopdf lockup situation. See also these discussions: - https://github.com/odoo/odoo/commit/8245c1d1d87b443701b161d8d4a42df2b4d13aec#commitcomment-22904347 - PR #12356 - Issue #2114 Closes #17998 --- openerp/service/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/service/server.py b/openerp/service/server.py index d1f74cee2c0..60068a6c06e 100644 --- a/openerp/service/server.py +++ b/openerp/service/server.py @@ -777,7 +777,7 @@ class WorkerHTTP(Worker): """ HTTP Request workers """ def process_request(self, client, addr): client.setblocking(1) - client.settimeout(0.5) + client.settimeout(2) client.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) # Prevent fd inherientence close_on_exec flags = fcntl.fcntl(client, fcntl.F_GETFD) | fcntl.FD_CLOEXEC