fix(job): make job timeout configurable via request param (backport to master)#556
Open
regdocs wants to merge 1 commit into
Open
fix(job): make job timeout configurable via request param (backport to master)#556regdocs wants to merge 1 commit into
regdocs wants to merge 1 commit into
Conversation
Backport of the configurable job-timeout feature from develop (f06c9a9). The @job decorator hardcoded the RQ job_timeout to 4h, so long-running jobs (e.g. streaming offsite backups) were SIGKILLed at 4h regardless of the timeout the endpoint requested. Read agent_job_timeout from the request body and thread it into enqueue_call, falling back to the configured job_timeout and then the 4h default.
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
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.
Backport
Backports the configurable job-timeout feature from
develop(commitf06c9a9, "fix(job): Make job timeout configurable so that job can pass as param") ontomaster.Why
The
@jobdecorator inagent/job.pyhardcoded the RQjob_timeoutto4 * 3600(4h) for every job. Long-running jobs — notably the new streaming offsite backup flow — were SIGKILLed by the RQ work-horse exactly 4h in, even though the endpoint (Press) requests a longer timeout (e.g. 18000s). The requested value was never consumed by the agent.What changed
agent/job.pyonly:job(...)gains an optionaltimeoutparam.agent_job_timeoutfrom the request JSON body when present.agent_job_timeout→ decoratortimeout→Server().config["job_timeout"]→DEFAULT_TIMEOUT(4h), clamped to[0, 24h].enqueue_callnow uses the resolved value instead of the hardcoded4 * 3600.No
web.pychanges are needed — the decorator reads the timeout generically, so all endpoints (including/backup) benefit.Notes
agent_job_timeoutis always sent as a number.master.