Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sync): full sync pagination #13940

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions kong-3.10.0-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ build = {
["kong.db.strategies.off.connector"] = "kong/db/strategies/off/connector.lua",
["kong.db.strategies.off.tags"] = "kong/db/strategies/off/tags.lua",

["kong.db.resumable_chunker] = "kong/db/resumable_chunker/init.lua",
["kong.db.resumable_chunker.chain] = "kong/db/resumable_chunker/chain.lua",
["kong.db.resumable_chunker.strategy] = "kong/db/resumable_chunker/strategy.lua",
["kong.db.resumable_chunker.utils] = "kong/db/resumable_chunker/utils.lua",

["kong.db.migrations.state"] = "kong/db/migrations/state.lua",
["kong.db.migrations.subsystems"] = "kong/db/migrations/subsystems.lua",
["kong.db.migrations.core"] = "kong/db/migrations/core/init.lua",
Expand Down
35 changes: 27 additions & 8 deletions kong/clustering/rpc/socket.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,41 @@ function _M:_get_next_id()
end


function _M:_report_error(payload_id, typ, err)
local res, rpc_err = self.outgoing:push(
new_error(payload_id, typ, err)
)

if not res then
ngx_log(ngx_WARN, "[rpc] unable to push RPC call error: ", rpc_err)
end
end


function _M._dispatch(premature, self, cb, payload)
if premature then
return
end

local res, err = cb(self.node_id, unpack(payload.params))
local ok, res, except, err, trace
xpcall(
function() res, err = cb(self.node_id, unpack(payload.params)) end,
function(err)
except = err
trace = debug.traceback(nil, 2)
end
)

if not ok then
ngx_log(ngx_WARN, "[rpc] exception during callback: ", except, "\n", trace)

return self:_report_error(payload.id, jsonrpc.INTERNAL_ERROR, except)
end

if not res then
ngx_log(ngx_WARN, "[rpc] RPC callback failed: ", err)

res, err = self.outgoing:push(new_error(payload.id, jsonrpc.SERVER_ERROR,
err))
if not res then
ngx_log(ngx_WARN, "[rpc] unable to push RPC call error: ", err)
end

return
return self:_report_error(payload.id, jsonrpc.SERVER_ERROR, err)
end

-- success
Expand Down
Loading
Loading