Skip to content
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

show response result in message traces #6359

Merged
merged 9 commits into from
Oct 11, 2024

Conversation

garlick
Copy link
Member

@garlick garlick commented Oct 10, 2024

Problem: flux module trace and flux overlay trace don't show the errnum value for response messages, but this would be helpful when interpreting message traces.

Append "success" or the error name associated with the errnum value in the one line trace output for responses.
When --full is specified, include human readable error message (if any) from the payload.
Change the color of failure response messages to bright red so they stand out.

Copy link
Contributor

@grondo grondo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. Not sure if it makes sense to add some tests...

@garlick
Copy link
Member Author

garlick commented Oct 10, 2024

Yeah could probably add some tests.

@garlick
Copy link
Member Author

garlick commented Oct 11, 2024

Added a little bit more testing (though it didn't do much for the numbers). Anyway, setting MWP.

Problem: the numerical constants used in overlay control messages
are defined locally to overlay.c but it is useful to decode them
in a message trace.

Move to overlay.h.
Problem: the broker contains duplicate code for tracing module and
overlay messages.

Factor out the duplicate code to trace.[ch].

Eliminate the check at each call site for empty 'trace_requests'
msglist and put the check in the trace function.

Add more defensive checks in the trace function.

The response payload now contains both 'name' and 'rank' fields, with
"name":null in the overlay response and "rank":-1 in the module response.
Both clients already allow extra fields so the clients need not change.
Problem: if there are multiple message tracers and one sets
the 'full' flag, all tracers get the message payload.

Only send the message payload if requested.
Problem: flux module trace and flux overlay trace do not show whether
a response indicates success or failure, but this would be useful.

Include the response errnum and error string (if available) in the
trace response.
Problem: strerrorname_np() is unavailable on non-glibc systems.

Add an implementation from gnulib to libmissing.
the license is LGPL-2.1+.
Problem: flux module trace doesn't show whether response messages
are a success or failure.

Add the errnum value from the message, converted to its short error name,
to the end of the message line.  If there is a human readable error message
in the payload, show it when --full is specified.  Show error responses
in bright red rather than cyan.
Problem: flux overlay trace doesn't show whether response messages
are a success or failure.

Add the errnum value from the message, converted to its short error name,
to the end of the message line.  If there is a human readable error message
in the payload, show it when --full is specified.  Show error responses in
bright red rather than cyan.
Problem: when flux-overlay trace encounters an error decoding
the trace response, it prints errors twice.

Use flux_msg_exit() not flux_err_exit().
Problem: there is no test coverage for flux module trace and
flux overlay trace's special handling of response messages.

Add a test for a failing RPC with human-readable error.
@mergify mergify bot merged commit 9ed4cfb into flux-framework:master Oct 11, 2024
31 checks passed
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 64.00000% with 45 lines in your changes missing coverage. Please review.

Project coverage is 83.28%. Comparing base (47040bc) to head (d462260).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
src/cmd/builtin/overlay.c 0.00% 26 Missing ⚠️
src/broker/trace.c 76.56% 15 Missing ⚠️
src/cmd/flux-module.c 84.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6359      +/-   ##
==========================================
- Coverage   83.31%   83.28%   -0.03%     
==========================================
  Files         523      524       +1     
  Lines       86199    86224      +25     
==========================================
- Hits        71814    71813       -1     
- Misses      14385    14411      +26     
Files with missing lines Coverage Δ
src/broker/module.c 78.81% <100.00%> (+0.75%) ⬆️
src/broker/overlay.c 83.82% <100.00%> (+0.14%) ⬆️
src/cmd/flux-module.c 79.48% <84.00%> (+0.20%) ⬆️
src/broker/trace.c 76.56% <76.56%> (ø)
src/cmd/builtin/overlay.c 77.47% <0.00%> (-2.43%) ⬇️

... and 12 files with indirect coverage changes

@garlick garlick deleted the trace_resp branch October 11, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants