changeset 5173:5373be93c0be

Upstream: warn if multiple non-stackable balancers are installed.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 12 Apr 2013 19:12:13 +0000
parents a4d21534cbf4
children f458156fd46a
files src/http/modules/ngx_http_upstream_ip_hash_module.c src/http/modules/ngx_http_upstream_least_conn_module.c
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_upstream_ip_hash_module.c
+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c
@@ -252,6 +252,11 @@ ngx_http_upstream_ip_hash(ngx_conf_t *cf
 
     uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
 
+    if (uscf->peer.init_upstream) {
+        ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+                           "load balancing method redefined");
+    }
+
     uscf->peer.init_upstream = ngx_http_upstream_init_ip_hash;
 
     uscf->flags = NGX_HTTP_UPSTREAM_CREATE
--- a/src/http/modules/ngx_http_upstream_least_conn_module.c
+++ b/src/http/modules/ngx_http_upstream_least_conn_module.c
@@ -387,6 +387,11 @@ ngx_http_upstream_least_conn(ngx_conf_t 
 
     uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
 
+    if (uscf->peer.init_upstream) {
+        ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+                           "load balancing method redefined");
+    }
+
     uscf->peer.init_upstream = ngx_http_upstream_init_least_conn;
 
     uscf->flags = NGX_HTTP_UPSTREAM_CREATE