Changeset 4569:1db899642518 in nginx


Ignore:
Timestamp:
04/02/12 21:29:35 (8 years ago)
Author:
Maxim Dounin <mdounin@…>
Branch:
default
Phase:
public
Convert:
svn:c3fe7df1-7212-e011-8a91-001109144009/trunk@4570
Message:

Upstream: reject upstreams without normal servers.

Such upstreams cause CPU hog later in the code as number of peers isn't
expected to be 0. Currently this may happen either if there are only backup
servers defined in an upstream block, or if server with ipv6 address used
in an upstream block.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/http/ngx_http_upstream_round_robin.c

    r4412 r4569  
    4848
    4949            n += server[i].naddrs;
     50        }
     51
     52        if (n == 0) {
     53            ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
     54                          "no servers in upstream \"%V\" in %s:%ui",
     55                          &us->host, us->file_name, us->line);
     56            return NGX_ERROR;
    5057        }
    5158
Note: See TracChangeset for help on using the changeset viewer.