-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_proxy_qretry.patch
68 lines (68 loc) · 3.38 KB
/
mod_proxy_qretry.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
diff -ur httpd-2.2.17.orig/modules/proxy/mod_proxy.c httpd-2.2.17/modules/proxy/mod_proxy.c
--- httpd-2.2.17.orig/modules/proxy/mod_proxy.c 2010-10-08 03:51:18.000000000 +0900
+++ httpd-2.2.17/modules/proxy/mod_proxy.c 2011-01-20 12:58:28.000000000 +0900
@@ -92,6 +92,18 @@
worker->retry = apr_time_from_sec(ival);
worker->retry_set = 1;
}
+ else if (!strcasecmp(key, "quick_retry")) {
+ ival = atoi(val);
+ if (ival < 1)
+ return "Quick_Retry must be at least one second";
+ worker->quick_retry = apr_time_from_sec(ival);
+ }
+ else if (!strcasecmp(key, "quick_retry_max")) {
+ ival = atoi(val);
+ if (ival < 0)
+ return "Quick_Retry_Max must be a positive number";
+ worker->quick_retry_max = ival;
+ }
else if (!strcasecmp(key, "ttl")) {
/* Time in seconds that will destroy all the connections
* that exceed the smax
Only in httpd-2.2.17/modules/proxy: mod_proxy.c~
diff -ur httpd-2.2.17.orig/modules/proxy/mod_proxy.h httpd-2.2.17/modules/proxy/mod_proxy.h
--- httpd-2.2.17.orig/modules/proxy/mod_proxy.h 2010-10-08 03:51:18.000000000 +0900
+++ httpd-2.2.17/modules/proxy/mod_proxy.h 2011-01-20 12:59:27.000000000 +0900
@@ -313,6 +313,8 @@
struct proxy_worker {
int id; /* scoreboard id */
apr_interval_time_t retry; /* retry interval */
+ apr_interval_time_t quick_retry; /* quick retry interval */
+ int quick_retry_max; /* quick retry max */
int lbfactor; /* initial load balancing factor */
const char *name;
const char *scheme; /* scheme to use ajp|http|https */
Only in httpd-2.2.17/modules/proxy: mod_proxy.h~
diff -ur httpd-2.2.17.orig/modules/proxy/proxy_util.c httpd-2.2.17/modules/proxy/proxy_util.c
--- httpd-2.2.17.orig/modules/proxy/proxy_util.c 2010-08-25 23:10:14.000000000 +0900
+++ httpd-2.2.17/modules/proxy/proxy_util.c 2011-01-20 13:02:09.000000000 +0900
@@ -1873,6 +1873,10 @@
if (!worker->retry_set) {
worker->retry = apr_time_from_sec(PROXY_WORKER_DEFAULT_RETRY);
}
+ if (!worker->quick_retry)
+ worker->quick_retry = apr_time_from_sec(PROXY_WORKER_DEFAULT_RETRY);
+ if (!worker->quick_retry_max)
+ worker->quick_retry_max = 0;
/* By default address is reusable unless DisableReuse is set */
if (worker->disablereuse) {
worker->is_address_reusable = 0;
@@ -1949,7 +1953,15 @@
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
"proxy: %s: retrying the worker for (%s)",
proxy_function, worker->hostname);
- if (apr_time_now() > worker->s->error_time + worker->retry) {
+ if (worker->s->retries < worker->quick_retry_max && apr_time_now() > worker->s->error_time + worker->quick_retry) {
+ ++worker->s->retries;
+ worker->s->status &= ~PROXY_WORKER_IN_ERROR;
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ "proxy: %s: worker for (%s) has been marked for quick_retry",
+ proxy_function, worker->hostname);
+ return OK;
+ }
+ else if (apr_time_now() > worker->s->error_time + worker->retry) {
++worker->s->retries;
worker->s->status &= ~PROXY_WORKER_IN_ERROR;
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
Only in httpd-2.2.17/modules/proxy: proxy_util.c~