Closed tzssangglass closed 4 months ago
/home/travis/build/openresty/lua-nginx-module/src/ngx_http_lua_balancer.c: In function ‘ngx_http_lua_balancer_notify_peer’:
/home/travis/build/openresty/lua-nginx-module/src/ngx_http_lua_balancer.c:747:17: error: ‘NGX_HTTP_UPSTREAM_NOTIFY_CACHED_CONNECTION_ERROR’ undeclared (first use in this function); did you mean ‘NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL’?
747 | if (type == NGX_HTTP_UPSTREAM_NOTIFY_CACHED_CONNECTION_ERROR) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL
/home/travis/build/openresty/lua-nginx-module/src/ngx_http_lua_balancer.c:747:17: note: each undeclared identifier is reported only once for each function it appears in
/home/travis/build/openresty/lua-nginx-module/src/ngx_http_lua_balancer.c: In function ‘ngx_http_lua_balancer_notify_peer’: /home/travis/build/openresty/lua-nginx-module/src/ngx_http_lua_balancer.c:747:17: error: ‘NGX_HTTP_UPSTREAM_NOTIFY_CACHED_CONNECTION_ERROR’ undeclared (first use in this function); did you mean ‘NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL’? 747 | if (type == NGX_HTTP_UPSTREAM_NOTIFY_CACHED_CONNECTION_ERROR) { | ^
~~~~~~~~~~~ | NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL /home/travis/build/openresty/lua-nginx-module/src/ngx_http_lua_balancer.c:747:17: note: each undeclared identifier is reported only once for each function it appears in
In the balancer phase, when obtaining a connection from the upstream connection pool, the
cached
attribute of the peer connection is set to 1(pc->cached = 1;
), indicating that the connection is obtained from the cache.If an error occurs during the use of this connection, such as "upstream prematurely closed connection" the system will increase the
tries
attribute of the peer connection by executingu->peer.tries++
.This PR restores tries by callbacks to the balancer when
u->peer.tries++
is unexpectedly set.I hereby granted the copyright of the changes in this pull request to the authors of this lua-nginx-module project.