From 5f761be4c3f1ddde8d29713c92d341e86fcefca7 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 7 Aug 2017 14:27:11 +1000 Subject: [PATCH] Add proxy-initial-not-pooled to proxy As described in the inline comment, we are seeing infrequent 502 errors in the logs that do seem to match what is described as a race-condition in the Apache documentation. As suggested there, enable proxy-initial-not-pooled in an attempt to avoid these. It says I"t has to be kept in mind that setting this variable downgrades performance, especially with HTTP/1.0 clients" ... downgraded performance would be preferable to 502 errors leading to long-running CI jobs failing randomly; so seems like a trade-off worth trying. Change-Id: I94a73e0fc07ca5b8903f4e74ad7c224509cea323 --- .../openstack_project/templates/mirror.vhost.erb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/openstack_project/templates/mirror.vhost.erb b/modules/openstack_project/templates/mirror.vhost.erb index 0e4068f840..53c1b7756e 100644 --- a/modules/openstack_project/templates/mirror.vhost.erb +++ b/modules/openstack_project/templates/mirror.vhost.erb @@ -122,6 +122,21 @@ NameVirtualHost <%= @vhost_name %>:8081 # 5GiB CacheMaxFileSize 5368709120 + # Added Aug 2017 in an attempt to avoid occasional 502 errors (around + # 0.05% of requests) of the type: + # + # End of file found: ... AH01102: error reading status line from remote server ... + # + # Per [1]: + # + # This avoids the "proxy: error reading status line from remote + # server" error message caused by the race condition that the backend + # server closed the pooled connection after the connection check by the + # proxy and before data sent by the proxy reached the backend. + # + # [1] https://httpd.apache.org/docs/2.4/mod/mod_proxy_http.html + SetEnv proxy-initial-not-pooled 1 + # Per site caching reverse proxy rules # Only cache specific backends, rely on afs cache otherwise.