Skip to content

Commit

Permalink
feat(clustering/rpc): support rpc batching on dp side (#14040)
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw authored Jan 14, 2025
1 parent b441f1e commit 1c2ea57
Show file tree
Hide file tree
Showing 5 changed files with 360 additions and 65 deletions.
13 changes: 13 additions & 0 deletions kong/clustering/rpc/manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ function _M.new(conf, node_id)
cluster_cert = assert(clustering_tls.get_cluster_cert(conf)),
cluster_cert_key = assert(clustering_tls.get_cluster_cert_key(conf)),
callbacks = callbacks.new(),

__batch_size = 0, -- rpc batching size, 0 means disable.
-- currently, we don't have Lua interface to initiate
-- a batch call, any value `> 0` should be considered
-- as testing code.
}

if conf.role == "control_plane" then
Expand Down Expand Up @@ -625,4 +630,12 @@ function _M:get_peer_info(node_id)
end


-- Currently, this function only for testing purpose,
-- we don't have a Lua interface to initiate a batch call yet.
function _M:__set_batch(n)
assert(type(n) == "number" and n >= 0)
self.__batch_size = n
end


return _M
Loading

1 comment on commit 1c2ea57

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:1c2ea578aee066a8468c8ae22cff65127b490248
Artifacts available https://github.com/Kong/kong/actions/runs/12763728090

Please sign in to comment.