-
Notifications
You must be signed in to change notification settings - Fork 49
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
convert broker from json-c to jansson (cleanup) #1050
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1050 +/- ##
==========================================
- Coverage 77.93% 77.68% -0.25%
==========================================
Files 148 148
Lines 25699 25739 +40
==========================================
- Hits 20028 19996 -32
- Misses 5671 5743 +72
|
Something's likely gone wrong here given the coverage drop - I'll have to look into this on monday. |
It is difficult to review the broker/exec commit because it is a conversion to jansson and a rewrite of the code. Ideally it would be split into an update to jansson, then the rewrite/refactor, (which seems to be good afaict), as this would be easier to review and follow in history. However, In this case since the work is already done and tests are passing I'd say go ahead and keep the changes. (But perhaps rename the commit message to |
Looking at the code coverage changes, I don't think there is a problem here per se, but the update to jansson does seem to add a lot more unchecked error conditions, which seems to account for majority of the misses I'm seeing. |
Sorry about the big, unreviewable diff. I didn't think about breaking it up while I was doing it, but I should have. I just forced a push with a better comment on that one, FWIW. |
I'll go ahead and split that commit into refactoring + json changes. Don't merge this as is please. |
Eh, I was saying it is fine as is, sorry just didn't get back around to
testing the PR yet.
…On May 1, 2017 6:29 AM, "Jim Garlick" ***@***.***> wrote:
I'll go ahead and split that commit into refactoring + json changes. Don't
merge this as is please.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1050 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtSUrBEDpA_eunk9rR2917WTqxxapc9ks5r1d43gaJpZM4NMRhC>
.
|
Problem: exec service stores attribute hash but only uses it once to obtain the 'local-uri' value. In exec_initialize(), obtain the local-uri value and cache that instead of the attribute hash.
In preparation for jansson conversion and more error handling for JSON-related failures, split the response payload creation out of child_exit_handler() into prepare_exit_payload().
In preparation for jansson conversion and more error handling for JSON-related failures, split the response payload creation out of child_io_cb() into prepare_io_payload(). child_io_cb() was renamed from subprocess_io_cb to avoid namespace confusion with the subprocess class.
In preparation for jansson conversion and more error handling for JSON-related failures, split the zio-decode and subprocess write calls from write_request_cb(). Alter request payload parsing logic slightly to make it easier to drop-in requestf.
Problem: flux_request_decodef() is called twice, once for required key, once for optional key. Call it once and use "s?:i" in the format specifier to indicate that the signal number is optional.
In preparation for jansson conversion and more error handling for JSON-related failures, split the subprocess allocation and configuration out from the cmb.exec handler.
I've split up the commits to the exec service into several refactoring commits and one final jansson conversion commit. |
Oh, thanks for all the work. Nice cleanup! One question that isn't clear from jansson docs, does |
Yes it's an inline so easy to check static JSON_INLINE
void json_decref(json_t *json)
{
if(json && json->refcount != (size_t)-1 && --json->refcount == 0)
json_delete(json);
} |
Ok, sorry I didn't do that! |
This PR is more cleanup. It converts the remaining broker C modules that use json-c to jansson.
@grondo it may be good for you to have a quick look over the exec.c commit proposed here. It's passing tests on my c9 image, but I did need to change it more than I wanted to make the error paths more clear (to me) as I worked through it. If this causes grief in your imp test branch, we can always skip this commit here and try again later.