Skip to content

Commit

Permalink
abandon dependent on check_index(check_module) if deleting backend se…
Browse files Browse the repository at this point in the history
…rver
  • Loading branch information
xiaokai-wang committed Jan 7, 2016
1 parent 351f9bc commit e252c6d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ngx_http_upsync_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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) {
Expand Down

2 comments on commit e252c6d

@xiaokai-wang
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @imjustfly

@xiaokai-wang
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.