Skip to content

Commit

Permalink
fix(clustering/rpc): negative id for notification timer name
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Feb 5, 2025
1 parent d47eab6 commit 7580ca5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kong/clustering/rpc/socket.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ function _M:process_rpc_msg(payload, collection)

-- collection is nil, it means it is a single call
-- we should call async function
-- for notification we will give it a negative fake id as timer's name
local name = string_format("JSON-RPC callback for node_id: %s, id: %d, method: %s",
self.node_id, payload_id or 0, payload_method)
self.node_id, payload_id or -math.random(10^5), payload_method)
res, err = kong.timer:named_at(name, 0, _M._dispatch, self, dispatch_cb, payload)

if not res and payload_id then
Expand Down

0 comments on commit 7580ca5

Please sign in to comment.