-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improve throttling in sync jobs #17716
Conversation
Co-authored-by: Zhengda Lu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kozlovb can you change the changelog to be this:
Fix the
DBMAsyncJob
class' job throttling feature by checking if the job should run instead of putting the thread to sleep. This prevents the class from holding the main check thread in cases where the job is run inSync
mode.
I don't think the current wording is straightforward, and our support people / customers will need to understand these changelog entries
Let me try to rephrase but I dont have a mental modal of support people knowledge of our internal classes. May be we should rather indicate to them that it's some internal stuff ? |
It's internal, but can affect the way the check runs. @christinaduffy57 maybe you can weigh in here? What would be useful to you in terms of wording? I think it makes sense to be a bit more technical |
What does this PR do?
The DBMAsyncJob class allows synchronous and asynchronous jobs to run at fixed intervals.
This PR updates the approach to throttling in the sync jobs of the DBMAsyncJob class. Rather than pausing a thread after executing the job, we now evaluate whether the job should proceed. For example, if a job is scheduled to run every 10 seconds and only 1 second has passed since its last execution, the run_job_loop call will not trigger the job.
Motivation
This change enables running synchronous jobs on the main thread without putting the main thread to sleep after each job execution.
Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.backport/<branch-name>
label to the PR and it will automatically open a backport PR once this one is merged