Backport Apache fix "Honor ProxyTimeout" (54973)
Bug #1509083 reported by
Robin Kluth
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Apache2 Web Server |
Fix Released
|
Critical
|
|||
apache2 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
As suggested by Manfred Hampl, I now open a bug report from this question:
I use Apache 2.4.7 with mod_proxy_fcgi which is affected of this bug: https:/
Is it possible to backport this patch to 2.4.7 (fixed in 2.4.8, see link @ bottom page)? Would be nice to use timeouts higher than 30 seconds ;)
My system is an up-to-date Ubuntu Server 14.04.3 LTS with Apache 2.4.7-1ubuntu4.8
Thanks in advance!
description: | updated |
description: | updated |
Changed in apache2: | |
importance: | Unknown → Critical |
status: | Unknown → Fix Released |
To post a comment you must log in.
mod_proxy_fcgi is configured to proxy request to php-fpm as follow: 127.0.0. 1:9000/ opt/httpd/ htdocs/ app/$1
ProxyPassMatch ^/(.*\.php)$ fcgi://
If a php script takes more than 30 seconds to execute, a HTTP RC 500 is returned to the client.
php max_execution_time is set to 300 seconds
I used the following script to validate that the error was not due to php max_execution_time issue.
<?php log("executing script... ");
error_ log("Logging: $t (".(time()-$time)." seconds)"); log("execution done (".(time()-$time)." seconds)");
error_
$time = time();
for ($t = 0; $t <= 15; $t++) {
sleep(5);
}
error_
?>
after 30 seconds, the HTTP 500 is returned to the client, but in the php error_log the script continue its execution.
According to the documentation, TimeOut is set to 60 seconds by default, so it should not be an issue, but in case, the following explicit definition were tested without improvement:
1. ProxyPassMatch ^/(.*\.php)$ fcgi:// 127.0.0. 1:9000/ opt/httpd/ htdocs/ app/$1 timeout=300
2. in virtual host: ProxyTimeout 300
3 in server config: TimeOut 300
The only workaround found was to hardcode the timeout in the mod_proxy_fcgi.c: proxy/mod_ proxy_fcgi. c.orig 2013-04-16 16:09:25.970332062 +0200 proxy/mod_ proxy_fcgi. c 2013-04-16 16:09:56.311088966 +0200 >s->timeout_ set) { from_sec( 30); from_sec( 300);
--- ./modules/
+++ ./modules/
@@ -575,7 +575,7 @@
/* We need SOME kind of timeout here, or virtually anything will
* cause timeout errors. */
if (! conn->worker-
- timeout = apr_time_
+ timeout = apr_time_
}
rv = apr_poll(&pfd, 1, &n, timeout);