-
Notifications
You must be signed in to change notification settings - Fork 240
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
Add result code to response messages #515
Conversation
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.
Thanks for submitting PR, I put a few comments.
@@ -735,8 +738,9 @@ class rpc_session | |||
try { | |||
ptr<buffer> resp_ctx = resp->get_ctx(); | |||
int32 resp_ctx_size = (resp_ctx) ? resp_ctx->size() : 0; | |||
int32 result_code_size = sizeof(int32_t); |
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.
Instead of this, can you please use
int32 result_code_size = sizeof(cmd_result_code);
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.
ok
my concern was that we will use the put_i32 and get_i32 functions, so it result_code_size is not sizeof(int32_t), weird things may happen
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.
Yeah, good point, that makes more sense. Let me make a change to use sizeof(int32_t)
and instead put int32_t
to cmd_result_code
definition.
18e0dc3
to
e49c962
Compare
In some cases, the response is marked as accepted even if there was an error. Therefore, including the accepted tag in the response message is not enough: a follower may believe that an auto forwarded request was successful when it wasn't. Signed-off-by: Alex Michon <[email protected]>
e49c962
to
3b2d3b3
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.
LGTM, Thanks.
In some cases, the response is marked as accepted even if there was an error. Therefore, including the accepted tag in the response message is not enough: a follower may believe that an auto forwarded request was successful when it wasn't.
Resolves #513