From e252c6ddf8c1d68ff7b31352a4e09aefee42dd2c Mon Sep 17 00:00:00 2001 From: Wang xiaokai Date: Thu, 7 Jan 2016 14:19:46 +0800 Subject: [PATCH] abandon dependent on check_index(check_module) if deleting backend server --- src/ngx_http_upsync_module.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ngx_http_upsync_module.c b/src/ngx_http_upsync_module.c index a3a553d..9aa6e17 100644 --- a/src/ngx_http_upsync_module.c +++ b/src/ngx_http_upsync_module.c @@ -1046,9 +1046,10 @@ ngx_http_upsync_del_peer(ngx_cycle_t *cycle, #if (NGX_HTTP_UPSTREAM_CHECK) ngx_http_upstream_check_delete_dynamic_peer( tmp_peers->name, &us->addrs[j]); - tmp_peers->peer[i].check_index = NGX_MAX_VALUE; #endif w -= tmp_peers->peer[i].weight; + tmp_peers->peer[i].down = NGX_MAX_VALUE; + break; } } @@ -2742,11 +2743,9 @@ ngx_http_upsync_del_delay_delete(ngx_event_t *event) if (tmp_peers != NULL) { for (i = 0; i < tmp_peers->number; i++) { -#if (NGX_HTTP_UPSTREAM_CHECK) - if (tmp_peers->peer[i].check_index != NGX_MAX_VALUE) { + if (tmp_peers->peer[i].down != NGX_MAX_VALUE) { continue; } -#endif saddr = tmp_peers->peer[i].sockaddr; if (saddr != NULL) {