-
Notifications
You must be signed in to change notification settings - Fork 50
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
job-info: avoid error response on failed rpc #6502
job-info: avoid error response on failed rpc #6502
Conversation
Problem: Some function parameter indentation is not aligned. Fix the tabbing.
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 although I suggested a little cleanup to make the code more readable.
@@ -763,7 +768,7 @@ static void main_namespace_lookup_continuation (flux_future_t *f, void *arg) | |||
"event", tok, toklen) < 0) { | |||
flux_log_error (ctx->h, "%s: flux_respond_pack", | |||
__FUNCTION__); | |||
goto error; | |||
goto cleanup; | |||
} | |||
} | |||
|
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.
Good catch! Though maybe the skip_respond_error
flag could be avoided if you just moved the error_cancel:
code into the one block that uses it and goto cleanup
from there?
src/modules/job-info/update.c
Outdated
json_t *context = NULL; | ||
const char *errmsg = NULL; | ||
const flux_msg_t *msg; | ||
bool skip_respond_error = false; | ||
|
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 comment on this one. Just call eventlog_watch_cancel()
at each goto error_cancel
site and goto error
or goto cleanup
from there as appropriate
Problem: Common usage in flux-core is to not respond with an RPC error (such as through flux_respond_error()) if a prior RPC attempt fails (such as through flux_respond_pack()). This pattern is violated in several places in job-info. Solution: If flux_respond_pack() fails, do not call flux_respond_error() in error handling paths. Fixes flux-framework#6498
2354a68
to
15aad44
Compare
thanks! Re-pushed with those tweeks, will set MWP |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6502 +/- ##
==========================================
- Coverage 83.63% 83.61% -0.02%
==========================================
Files 525 525
Lines 87682 87682
==========================================
- Hits 73334 73317 -17
- Misses 14348 14365 +17
|
Problem: Common usage in flux-core is to not respond with an RPC error
(such as through flux_respond_error()) if a prior RPC attempt fails (such
as through flux_respond_pack()). This pattern is violated in several
places in job-info.
Solution: If flux_respond_pack() fails, do not call flux_respond_error()
in error handling paths.
Fixes #6498