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

scheduler/job.c: Fix extensive logging in scheduler #767

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

zdohnal
Copy link
Member

@zdohnal zdohnal commented Jul 27, 2023

Based on currently unknown trigger scheduler sometimes sets JobHistoryUpdate into past, which causes select() to timeout after one second.

It happens when job->file_time of a job without files to remove gets assigned to JobHistoryUpdate. If we check for job->num_files and assign the job->file_time only if there are any, we will fix extensive logging (and unneeded cupsd execution) in various places, e.g. cleaning jobs, expiring subscriptions, deleting temporary queues...

Fixes #604

Based on currently unknown trigger scheduler sometimes sets
JobHistoryUpdate into past, which causes `select()` to timeout after one
second.

It happens when `job->file_time` of a job without files to remove gets
assigned to `JobHistoryUpdate`. If we check for `job->num_files` and
assign the `job->file_time` only if there are any, we will fix extensive
logging (and unneeded cupsd execution) in various places, e.g. cleaning
jobs, expiring subscriptions, deleting temporary queues...

Fixes OpenPrinting#604
Copy link
Member

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

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

LGTM

@zdohnal zdohnal merged commit 3c23d47 into OpenPrinting:master Jul 27, 2023
6 checks passed
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.

cupsd sometimes enters a infinite loop when timeout variable gets lower than current_time
2 participants