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

libflux: handle flux_respond_error (errnum=0) #4427

Merged
merged 3 commits into from
Jul 26, 2022

Conversation

garlick
Copy link
Member

@garlick garlick commented Jul 25, 2022

Problem: if flux_respond_error() is called with errnum of 0, no response is sent, which can cause hard to diagnose problems.

Use EINVAL if errnum is zero.

Fixes #3036

Copy link
Member

@chu11 chu11 left a comment

Choose a reason for hiding this comment

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

LGTM

@garlick
Copy link
Member Author

garlick commented Jul 26, 2022

Added a spot of test coverage and rebased on current master.

@garlick
Copy link
Member Author

garlick commented Jul 26, 2022

I'll go ahead and set MWP on this one.

garlick added 3 commits July 26, 2022 18:44
Problem: if flux_respond_error() is called with errnum of 0,
no response is sent, which can cause hard to diagnose problems.

Use EINVAL if errnum is zero.

Fixes flux-framework#3036
Problem: flux_respond(3) man page says that errnum must be
non-zero but that is no longer the case.

Document the fact that EINVAL now is used if errnum is zero.
Problem: there is no test coverage that checks that
flux_respond_error() sends an EINVAL response if errnum=0.

Add this to response unit test.
@codecov
Copy link

codecov bot commented Jul 26, 2022

Codecov Report

Merging #4427 (1e01aee) into master (d1c1075) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 1e01aee differs from pull request most recent head d696136. Consider uploading reports for the commit d696136 to get more accurate results

@@            Coverage Diff             @@
##           master    #4427      +/-   ##
==========================================
- Coverage   83.33%   83.33%   -0.01%     
==========================================
  Files         396      396              
  Lines       66769    66771       +2     
==========================================
+ Hits        55642    55643       +1     
- Misses      11127    11128       +1     
Impacted Files Coverage Δ
src/common/libflux/response.c 89.89% <100.00%> (+0.10%) ⬆️
src/broker/state_machine.c 80.91% <0.00%> (-0.80%) ⬇️
src/common/libsubprocess/server.c 61.08% <0.00%> (-0.28%) ⬇️
src/shell/output.c 76.54% <0.00%> (-0.16%) ⬇️
src/broker/overlay.c 86.79% <0.00%> (+0.51%) ⬆️

@mergify mergify bot merged commit e4b232f into flux-framework:master Jul 26, 2022
@garlick garlick deleted the respond_error_0 branch July 26, 2022 22:03
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.

flux_respond_error: accept an errnum of 0
2 participants