]> git.kaiwu.me - nginx.git/commitdiff
Upstream: warn if multiple non-stackable balancers are installed.
authorRuslan Ermilov <ru@nginx.com>
Fri, 12 Apr 2013 19:12:13 +0000 (19:12 +0000)
committerRuslan Ermilov <ru@nginx.com>
Fri, 12 Apr 2013 19:12:13 +0000 (19:12 +0000)
src/http/modules/ngx_http_upstream_ip_hash_module.c
src/http/modules/ngx_http_upstream_least_conn_module.c

index 89ccc2b858f4e8c7600be1e217919400e5e282ff..29c74fd54d0a3ff303a814d953c12f47c66ef8c1 100644 (file)
@@ -252,6 +252,11 @@ ngx_http_upstream_ip_hash(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
     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
index 6066ed2bb84d9b9d838c05f61a48b8d085ec792e..87c4d8d613b7bec53af063ae1ac362685dd83fea 100644 (file)
@@ -387,6 +387,11 @@ ngx_http_upstream_least_conn(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
     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