Skip to content

Remember failed job lookups instead of retrying every frame - #57

Merged
fedonman merged 1 commit into
mainfrom
fixed/cache-failed-job-lookups
Sep 29, 2026
Merged

fedonman merged 1 commit into
mainfrom
fixed/cache-failed-job-lookups

Conversation

@fedonman

Copy link
Copy Markdown
Owner

JobDetailResolver cached a job's detail only when scontrol succeeded, and draw() requests it on every frame, so a failed lookup forked scontrol again on each redraw for as long as the cursor stayed on the job. A failure now goes into the same LRU cache with its time, and the job is looked up again only after 10 seconds, so a job that has left slurmctld costs one lookup per 10 s and a transient controller error still clears up. The lookup is injectable so the tests can count calls without a real scontrol.

Closes #22

JobDetailResolver cached a job's detail only when scontrol succeeded,
and draw() requests the focused job's detail on every frame, so once a
lookup failed, for example because the job had aged out of slurmctld,
sqwatch forked scontrol on every redraw for as long as the cursor stayed
there. A failure now goes into the same LRU cache with its time, and
the job is looked up again only after RETRY_AFTER (10 s), so a
transient controller error still clears. The lookup is injectable so
the tests can count calls without a real scontrol.
@fedonman
fedonman force-pushed the fixed/cache-failed-job-lookups branch from ecf7146 to dc3bdc7 Compare September 29, 2026 09:31
@fedonman
fedonman merged commit f524666 into main Sep 29, 2026
6 checks passed
@fedonman
fedonman deleted the fixed/cache-failed-job-lookups branch September 29, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: A failed scontrol lookup is retried on every frame, forever

1 participant