fix(jobs): don't overwrite the --stop_after baseline in background-job:worker - #63297
Open
vaenda wants to merge 1 commit into
Open
fix(jobs): don't overwrite the --stop_after baseline in background-job:worker#63297vaenda wants to merge 1 commit into
vaenda wants to merge 1 commit into
Conversation
…b:worker $startTime was used for two different things: as baseline for --stop_after and as start time of the currently running job. The variable was reassigned during each loop with each new job in the queue, so the baseline for --stop_after was lost and the worker never terminated. Renaming the job variable fixes this issue. Assisted-by: Claude:claude-opus-5 Signed-off-by: Sven Hansen <vaenda@vaenda.de>
vaenda
requested review from
Altahrim,
CarlSchwan,
come-nc and
leftybournes
and removed request for
a team
August 15, 2026 21:19
Member
|
/backport to stable34 |
solracsf
approved these changes
Aug 15, 2026
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.
Resolves: #63296
Summary
$startTime was used for two different things:
as baseline for --stop_after and as start time of the currently running job. The variable was reassigned during each loop with each new job in the queue, so the baseline for --stop_after was lost and the worker never terminated.
Renaming the job variable fixes this issue. I applied the patch to my instance and measured it before and after: unpatched the worker was still running after 120s with -t 20s, patched it exits after 20.97s, and after 45.83s with -t 45s.
Checklist
— there is no
tests/Core/Command/Background/directory, these commandsare not covered by unit tests. Happy to add one if you want the timing
loop covered.
to the maintainers
AI usage
I had Claude Code work through a large background job backlog on my own Nextcloud instance, and it ran into
--stop_afternot stopping the worker. It located the cause in the code and suggested the rename. I applied the patch to my instance and measured it before and after: unpatched the worker was still running after 120s with-t 20s, patched it exits after 20.97s, and after 45.83s with-t 45s. The commit carries anAssisted-by: Claude:claude-opus-5trailer.