Add a config for enforcing a minimum job reserve interval (default: 0 for now)#48
Merged
smudge merged 3 commits intoBetterment:mainfrom Dec 18, 2024
Merged
Conversation
Member
|
Should a default behavior change like this be reserved for a major version? Like introduce the param at 0 seconds in 0.6 and then pop it to 1s at 1.0? |
867eebb to
200beb5
Compare
jmileham
approved these changes
Dec 18, 2024
Member
jmileham
left a comment
There was a problem hiding this comment.
domain lgtm too! Will leave platform to somebody closer/more current, if we want that. But I also think Nathan's currency satisfies that requirement for me for no-platform.
effron
reviewed
Dec 18, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is related to #41 and #42 insofar as a kind of DB-bound "spinloop" is still possible if a worker picks up jobs that take so little time that the worker immediately turns around and asks for more. As of now, there has been no way to tune the amount of time a worker should wait in between successful iterations of its run loop.
This introduces a configuration (
min_reserve_interval) specifying a minimum number of seconds (default: 0 as this is not a major release) that a worker should wait in between successful job reserve queries. An existing config (sleep_delay) is still used to define the number of seconds (default: 5) that a worker should wait in between unsuccessful job reserve attempts (i.e. the queue is empty).The job execution time is subtracted from
min_reserve_intervalwhen the worker sleeps, and if jobs take more thanmin_reserve_intervalto complete than the worker will not sleep before the next reserve query./no-platform