Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a WIP to add find to fluxion-go. Currently I am getting back what looks like an OK result (out) but the error code is 199, which does not make sense. B̶e̶f̶o̶r̶e̶ ̶I̶ ̶c̶o̶n̶t̶i̶n̶u̶e̶ ̶a̶d̶d̶i̶n̶g̶ ̶t̶e̶s̶t̶s̶ ̶I̶ ̶n̶e̶e̶d̶ ̶t̶o̶ ̶f̶i̶g̶u̶r̶e̶ ̶o̶u̶t̶ ̶w̶h̶y̶ ̶t̶h̶e̶ ̶e̶r̶r̶o̶r̶ ̶c̶o̶d̶e̶ ̶i̶s̶ ̶1̶9̶9̶.̶ ̶H̶e̶r̶e̶ ̶i̶s̶ ̶w̶h̶a̶t̶ ̶t̶h̶a̶t̶ ̶l̶o̶o̶k̶s̶ ̶l̶i̶k̶e̶ ̶-̶ ̶w̶h̶e̶n̶ ̶I̶ ̶c̶h̶a̶n̶g̶e̶ ̶t̶h̶e̶ ̶c̶r̶i̶t̶e̶r̶i̶a̶ ̶t̶o̶ ̶
̶s̶t̶a̶t̶u̶s̶=̶d̶o̶w̶n̶
̶ ̶i̶t̶ ̶r̶e̶t̶u̶r̶n̶s̶ ̶s̶u̶c̶c̶e̶s̶s̶f̶u̶l̶l̶y̶ ̶(̶n̶o̶ ̶e̶r̶r̶o̶r̶)̶ ̶b̶u̶t̶ ̶w̶i̶t̶h̶ ̶n̶o̶ ̶o̶u̶t̶.̶ ̶S̶o̶ ̶I̶ ̶w̶o̶n̶d̶e̶r̶ ̶i̶f̶ ̶i̶t̶'̶s̶ ̶r̶e̶l̶a̶t̶e̶d̶ ̶t̶o̶ ̶t̶h̶e̶ ̶i̶n̶p̶u̶t̶ ̶c̶r̶i̶t̶e̶r̶i̶a̶ ̶o̶r̶ ̶p̶a̶r̶s̶i̶n̶g̶ ̶o̶f̶ ̶o̶u̶t̶p̶u̶t̶Update - figured it out, see below.
The error code of 199 is coming from inside of the fluxion find function! So it's not a weird conversion between types, etc.
OK, it's the writers->emit_json function.
Interesting, so
check_array_sizes
I think is just possibly returning the size? In which case the value that gets passed up isn't an error!Note that the function is here and (I would guess) the reason it returns a higher positive value is because the return code is calculated as the sum of the two calls:
https://github.com/flux-framework/flux-sched/blob/da6156addab5ec127b36cdee03c5d1f3e458d363/resource/writers/match_writers.cpp#L388-L390
That seems kind of weird? Going to add some prints to verify. The function
json_array_size
is from jansson and does seem to return the number of elements.Verifying that we are returning the sum of sizes:
If that is really supposed to be a return code, I think we should be doing the following in the function that calls it.
In the above, if the call is successful and returns a positive number, we reset it to 0. I think we could also just do:
If there is something meaningful negative return value, we could capture it into another value (and set to rc if it's <=0. And then in the success case, rc will still be 0 from when it was originally set. I think for now I'm going to assume that anything greater than zero returned from find is a success. This might be "business as usual" for C++, but it did go against my expectation and I think we might either:
I'll pick up on this tomorrow - can't wait to try the rest of find! It seems like the first way to peek into what fluxion is doing (or the state). 👀