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
Exit code fix #93
Exit code fix #93
Conversation
@pkalever Could you add a bit more details about what is the problem and how it addresses the problem? |
rpc/block_svc_routines.c
Outdated
@@ -3783,6 +3782,7 @@ blockCreateCliFormatResponse(struct glfs *glfs, blockCreateCli *blk, | |||
blockFormatErrorResponse(CREATE_SRV, blk->json_resp, errCode, | |||
GB_DEFAULT_ERRMSG, reply); | |||
} | |||
reply->exit = errCode; |
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.
For the BUG raised, this line fixes the problem. Create exit code is not collected before, so fixing the code to collect the right exit 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.
@pkalever If you look at the pull request/commit message it doesn't explain the problem what you encountered and how it is solving it. People generally do that when a patch is sent, otherwise the context will be forgotten after a few months. I just want you to capture that in the pull request.
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.
@pkalever Thanks for the commit message. I am seeing similar issue in modify, resize, info. I think even in Delete we can move it to the end like you did here. Did you get a chance to check those as well? Am I missing some other detail?
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.
Done, thanks!
@pranithk I have updated the commit msg. |
@pranithk after fixing your review comments. I have tested create/info/list/modify (auth/size)/delete operations with and without json flag and validated the exit code for success paths. In all the cases I got exit code 0. Thanks! |
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.
Changes look okay, but the commit message still says create, instead of the wide range of cli operations for which it works now.
also tuned few logs to look more meaningful Reviewed-by: Pranith Kumar K <pkarampu@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
In version check failure paths, we are not updating the reply->exit variable. This patch will makesure about updating reply->exit value in all block*CliFormatResponse() functions, so that we never miss to update the right exitCode. Also improved some code for better readability. Reviewed-by: Pranith Kumar K <pkarampu@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
As discussed, In addition to this for -ve testing, have run create//modify (auth/size)/delete ops while "for i in {1..100000}; do pkill -9 targetcli; done" is running on one of the HA node with and without json flag, In all the cases I got exit code 255. Will paste the output next to this comment. Thanks! |
@pranithk here is the output:
|
No description provided.