You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function retrieves information about whether the connection used in the previous attempt came from the upstream connection pool when the next_upstream retrying mechanism is in action.
538
-
539
-
The possible results are as follows:
540
-
-`false`: Indicates the connection was not reused from the upstream connection pool, meaning a new connection was created with the upstream in the previous attempt.
541
-
-`true`: Indicates the connection was reused from the upstream connection pool, meaning no new connection was created with the upstream in the previous attempt.
542
-
543
-
After applying the [dynamic upstream keepalive patch](https://github.com/Kong/kong/blob/3.6.0/build/openresty/patches/ngx_lua-0.10.26_01-dyn_upstream_keepalive.patch),
544
-
Nginx's upstream module attempts to retrieve connections from the upstream connection pool for each retry.
545
-
If the obtained connection is deemed unusable, Nginx considers that retry invalid and performs a compensatory retry.
546
-
547
-
Since each retry triggers the `balancer_by_lua` phase, the number of retries logged in Lua land during this phase may exceed the maximum limit set by `set_more_tries`.
548
-
549
-
Using this function in the `balancer_by_lua` phase allows for determining if the connection used in the previous retry was taken from the connection pool.
550
-
If the return value is `true`, it indicates that the connection from the pool used in the previous retry was unusable, rendering that retry void.
551
-
552
-
The value returned by this function helps in accurately assessing the actual number of new connections established with the upstream server during the retry process during the `balancer_by_lua phase`.
0 commit comments