Skip to content

Commit

Permalink
fix: race condition problem while update upstream.nodes
Browse files Browse the repository at this point in the history
Signed-off-by: Nic <[email protected]>
  • Loading branch information
nic-6443 committed Jan 15, 2025
1 parent d4d99e7 commit 125f8a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apisix/upstream.lua
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ function _M.set_by_route(route, api_ctx)
return HTTP_CODE_UPSTREAM_UNAVAILABLE, "invalid nodes format: " .. err
end

local new_up_conf = core.table.clone(up_conf)
up_conf.nodes = new_nodes
up_conf.original_nodes = up_conf.nodes

local new_up_conf = core.table.clone(up_conf)
core.log.info("discover new upstream from ", up_conf.service_name, ", type ",
up_conf.discovery_type, ": ",
core.json.delay_encode(new_up_conf, true))
Expand Down

0 comments on commit 125f8a1

Please sign in to comment.