membphis commented on a change in pull request #3278:
URL: https://github.com/apache/apisix/pull/3278#discussion_r557051593
##########
File path: apisix/balancer/chash.lua
##########
@@ -38,6 +38,9 @@ local function fetch_chash_hash_key(ctx, upstream)
chash_key = ctx.var["http_" .. key]
elseif hash_on == "cookie" then
chash_key = ctx.var["cookie_" .. key]
+ elseif hash_on == "vars_combinations" then
+ chash_key = core.utils.resolve_var(key, ctx.var);
+ core.log.info("vars_combinations: " .. chash_key)
Review comment:
`val, err = core.utils.resolve_var(key, ctx.var)`
this step may return `nil, err` case, we need to check the return value.
code style, here is a better one:
```lua
chash_key = core.utils.resolve_var(key, ctx.var)
core.log.info("vars_combinations: ", chash_key)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]