-
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
libflux: update API to use size_t where appropriate #6467
Conversation
haven't skimmed all of it yet, had initial concerns the change could bleed into the KVS related to #6266 but I think it's ok. Second thought, we'll need changes to flux-sched too? I think flux-coral2 and flux-accounting will probably be ok. |
fff85a1
to
b06d055
Compare
4745a82
to
038d1d7
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6467 +/- ##
==========================================
- Coverage 83.61% 83.61% -0.01%
==========================================
Files 524 524
Lines 87623 87625 +2
==========================================
Hits 73268 73268
- Misses 14355 14357 +2
|
This has been reworked a bit but the API facing changes are as originally proposed. In the previous iteration I had introduced a signed arithmetic error that caused a -1 error return not to be detected in the content stack. So in this iteration, I scrutinized each change more carefully and was a little more conservative. There are probably more places that could internally be converted to use |
This is ready for review in case that wasn't clear :-) No rush of course. |
The change in the ABI appears to break both the flux-pmix and flux-sched builds, e.g.: Were we going to first fix those projects first (and perhaps spot check some others that aren't testing in CI)?
|
Sorry, yes, I'll get PRs up for the failing projects and give an audit to the others. |
Problem: the raw RPC interfaces are changing to use a size_t instead of int for payload size. Update scheduler usage. flux-framework/flux-core#6467 must be merged before this will pass CI.
Problem: the raw message payload interfaces are changing to use a size_t instead of int. Update usage in interthread. flux-framework/flux-core#6467 must be merged before this will pass CI.
Problem: the raw RPC interfaces are changing to use a size_t instead of int for payload size. Update dyad usage. flux-framework/flux-core#6467 must be merged before this will pass CI.
I'm only glancing at this, have an SI checkin in a few minutes, but came here after seeing the switching to size_t title to ask if we might be better off with There's so much |
Fair point, but I think probably it makes sense to conform with similar usage in the C library and posix here. The unsigned value in these interfaces removes ambiguity about whether a value should be checked for negative for some kind of error/special meaning too. |
PRs are up for flux-sched, flux-pmix, and dyad. I didn't spot any others. |
Ok, we'll have to rebase this branch, then force a merge (which may require temporary removal of branch protections, I can't remember if the big button will work without that) |
Problem: some code does not conform to RFC 7 and project norms. Break long parameter lists to one per line. Format pack/unpack with key-value pairs on the same line.
Problem: some public functions have new footprints but the section 3 manual does not reflect this. Update manual.
Problem: some libflux interfaces use the C int type to represent buffer and I/O sizes, but size_t, as an unsigned type with more range, is more appropriate in public interfaces. Convert the following public API interfaces to use size_t: flux_msg_get_payload() flux_msg_set_payload() flux_request_decode_raw() flux_request_encode_raw() flux_response_decode_raw() flux_response_encode_raw() flux_respond_raw() flux_event_encode_raw() flux_event_decode_raw() flux_event_publish_raw() flux_rpc_raw() flux_rpc_get_raw() flux_kvs_lookup_get_raw() flux_kvs_txn_put_raw() Update tests and in-tree users, where appropriate.
Problem: several functions in the internal blobref class use int types where size_t would be more appropriate. Switch to size_t.
Problem: several functions in the internal filemap and fileref classes use int types where size_t would be more appropriate. Switch to size_t. Update unit test.
Problem: a function in the internal mpart class uses an int type where size_t would be more appropriate. Switch to size_t.
Problem: several functions in the internal stdlog class use int types where size_t would be more appropriate. Switch to size_t. Update unit test. Update users.
Rebased. |
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. Adding approval for completeness.
Ok, forcing a merge. |
Thanks @grondo! I'll go kick CI in the three other PRs. |
OK kicked sched and pmix. The dyad one was already passing - maybe I patched dead code. No urgency over there I guess. |
Problem: some libflux interfaces use the C
int
type to represent buffer and I/O sizes, butsize_t
, as an unsigned type with more range, is more appropriate in public interfaces.Convert the following public API interfaces to use
size_t
:Update tests and in-tree users, where appropriate.