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

job-list: initialize queue stats #5712

Merged

Conversation

chu11
Copy link
Member

@chu11 chu11 commented Jan 31, 2024

Problem: Job queue stats are generated in job-list when a job is submitted into it. If a job queue never has a job submitted to it, no job stats exist for the queue. This isn't what users would expect, they should expect queue stats to be 0 for the queue.

Solution: Read the flux config and initialize queue stats to 0 for any queues that have been configured.

Fixes #5688


Uhhh I clearly messed up my branch with rebasing somehow ... will fix

I'm not sure why a CodeQL warning showed up in this PR. I figured the "not a warning" in original PR was enough, but I guess not?? Or maybe b/c it was due to my messed up rebasing earlier. Anyways, I just added a tiny fix to fix it.

Oh yeah, side note. Implementation may look a little weird. Why have config_reload() call down into stats.[ch], why not put everything in stats.c? I needed config reload setup for another PR, so decided to just solve this issue first along the way.

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Merging #5712 (4e0bef5) into master (13311a9) will increase coverage by 28.08%.
Report is 22 commits behind head on master.
The diff coverage is 85.16%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5712       +/-   ##
===========================================
+ Coverage   55.38%   83.46%   +28.08%     
===========================================
  Files         439      486       +47     
  Lines       75169    82933     +7764     
===========================================
+ Hits        41631    69219    +27588     
+ Misses      33538    13714    -19824     
Files Coverage Δ
src/bindings/python/flux/job/event.py 98.46% <100.00%> (+69.19%) ⬆️
src/bindings/python/flux/job/output.py 93.82% <100.00%> (+74.35%) ⬆️
src/broker/boot_pmi.c 68.26% <100.00%> (+10.52%) ⬆️
src/common/libutil/ipaddr.c 81.08% <100.00%> (+12.50%) ⬆️
src/modules/job-list/job_state.c 76.34% <100.00%> (+33.27%) ⬆️
src/bindings/python/flux/job/watcher.py 94.21% <81.81%> (+76.61%) ⬆️
src/bindings/python/flux/kvs.py 94.94% <96.96%> (+67.91%) ⬆️
src/common/libterminus/client.c 83.49% <78.57%> (+29.36%) ⬆️
src/modules/job-list/stats.c 75.30% <81.25%> (+51.08%) ⬆️
src/modules/job-ingest/job-ingest.c 68.44% <0.00%> (+22.58%) ⬆️
... and 2 more

... and 397 files with indirect coverage changes

@chu11 chu11 force-pushed the issue5688_job_list_missing_queue_stats branch from 4e0bef5 to 613eee0 Compare January 31, 2024 16:23
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.

LGTM, just noticed a couple typos in the first commit.

@@ -45,18 +45,19 @@ static void free_wrapper (void **item)
}

static struct job_stats *queue_stats_lookup (struct job_stats_ctx *statsctx,
struct job *job)
Copy link
Contributor

Choose a reason for hiding this comment

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

Commit message: looksup -> looks up

Also, 3 spaces between the period and "In a few cases..."

chu11 added 4 commits February 1, 2024 15:48
Problem: The internal queue_stats_lookup() function looks up
a stats structure for a queue and creates one if it is missing.
But in a few cases, this makes no sense.  For example, when a
job is being purged, it should be (generally) impossible that
queue stats don't exist.

Add a boolean indicating if the queue stats should be created
or not in queue_stats_lookup().  In a few cases where it's undesireable for
queue_stats_lookup() to return no queue stats, output some
debugging error info.

Also, have queue_stats_lookup() take a queue name instead of a
"struct job" as input, as the queue name is what is actually necessary.
Problem: Job queue stats are generated in job-list when a job
is submitted into it.  If a job queue never has a job submitted
to it, no job stats exist for the queue.  This isn't what users
would expect, they should expect queue stats to be 0 for the queue.

Solution: Read the flux config and initialize queue stats to 0 for
any queues that have been configured.

Fixes flux-framework#5688
Problem: A test in t2260-job-list.t assumes there will be no
job queue stats if a job has never been submitted to it.  That
behavior was recently changed.

Update the test to check for non-empty queue stats for queues
that should have no jobs "submitted" to it.  Also add a new
"nosubmitqueue" to the test for additional coverage.
Problem: CodeQL outputs a warning that an except clause is
empty without a comment.

Add a comment to eliminate the warning.
@chu11 chu11 force-pushed the issue5688_job_list_missing_queue_stats branch from e9ad433 to 7958552 Compare February 1, 2024 23:49
@chu11
Copy link
Member Author

chu11 commented Feb 1, 2024

thanks! fixed, rebased, and setting MWP

@mergify mergify bot merged commit 2527c83 into flux-framework:master Feb 2, 2024
33 checks passed
@chu11 chu11 deleted the issue5688_job_list_missing_queue_stats branch February 2, 2024 00:20
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.

job-list: stats missing for configured queue
2 participants