-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
refactor(clustering/rpc): support rpc batching on dp side #14040
base: master
Are you sure you want to change the base?
Conversation
92b6976
to
e47aa67
Compare
Since this feature is hard to test, I will add it to concentrator in another PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (1)
- kong/clustering/rpc/socket.lua: Language not supported
fd48976
to
4a3d7fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blockers
local res, err = self:push_response( | ||
new_error(nil, jsonrpc.INVALID_REQUEST, "not a valid object"), | ||
collection) | ||
if not res then | ||
return nil, err | ||
end | ||
|
||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local res, err = self:push_response( | |
new_error(nil, jsonrpc.INVALID_REQUEST, "not a valid object"), | |
collection) | |
if not res then | |
return nil, err | |
end | |
return true | |
return self:push_response( | |
new_error(nil, jsonrpc.INVALID_REQUEST, "not a valid object"), | |
collection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do it, but this style should be consistent with line 186:
186 local reso, erro = self:push_response(new_error(payload_id, jsonrpc.INTERNAL_ERROR),
187 "unable to send \"INTERNAL_ERROR\" error back to client: ",
188 collection)
189 if not reso then
190 return nil, erro
191 end
193 return nil, "unable to dispatch JSON-RPC callback: " .. err
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to accept xuming's advice.
We should not block this improvement to try to align with L186. Because L186's error has a prefix error"unable to dispatch JSON-RPC callback: "
WIthout xuming's fix, otherwise, this logic always let reviewers feel odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I think we could return errno. without a prefix error. This is simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do it in another refactor PR.
local res, err = self:push_response(new_error(payload_id, jsonrpc.METHOD_NOT_FOUND), | ||
"unable to send \"METHOD_NOT_FOUND\" error back to client: ", | ||
collection) | ||
if not res then | ||
return nil, err | ||
end | ||
|
||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. By simplifying the code we reduce the noise and improve readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We keep the same call style of self:push_response
in the code, as my opinion it may not be changed in this PR.
edb1185
to
596ecba
Compare
Summary
KAG-5934
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
Fix #[issue number]