Skip to content

Commit

Permalink
check payload.id
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Jan 20, 2025
1 parent b315d51 commit 8acaf96
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kong/clustering/rpc/concentrator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ function _M:process_one_response(payload)
assert(payload.jsonrpc == jsonrpc.VERSION)
local payload_id = payload.id

-- may be some error message for peer
if not payload_id then
if payload.error then
ngx_log(ngx_ERR, "[rpc] RPC failed, code: ",
payload.error.code, ", err: ",
payload.error.message)
end
return
end

-- response
local cb = self.interest[payload_id]
self.interest[payload_id] = nil -- edge trigger only once
Expand Down

0 comments on commit 8acaf96

Please sign in to comment.