Skip to content

feat(chart): expose the worker task watchdog as worker.taskMaxRuntime - #57

Merged
thomasboni merged 1 commit into
mainfrom
feat/worker-task-max-runtime
Sep 6, 2026
Merged

feat(chart): expose the worker task watchdog as worker.taskMaxRuntime#57
thomasboni merged 1 commit into
mainfrom
feat/worker-task-max-runtime

Conversation

@thomasboni

Copy link
Copy Markdown
Contributor

Adds worker.taskMaxRuntime, so the worker task watchdog can be configured from the chart. It previously could not be, and every deployment silently inherited the application default of 3m.

Why

Opening an analysis enumerates every governed project from GitLab, and that enumeration is a single worker task. The watchdog kills the worker process if any one task exceeds JOBS_WORKER_TASK_MAX_RUNTIME.

On an estate of a few thousand projects that enumeration takes far longer than 3 minutes. Measured on our test instance: 3,708 projects, 80 GitLab GraphQL calls averaging 4.7s, about 6m20 total. The result is a loop:

  1. Worker starts enumerating
  2. Watchdog fires at 3m, WATCHDOG: Task exceeded max runtime, process exits
  3. The task is recovered and requeued
  4. Repeat

The analysis is accepted, reports 0 tasks, and never progresses. Nothing surfaces to the user as an error.

What it renders

Only on the worker deployment, since only the process started with --worker reads it:

plumber-front     JOBS_WORKER_TASK_MAX_RUNTIME: no
plumber-backend   JOBS_WORKER_TASK_MAX_RUNTIME: no
plumber-worker    JOBS_WORKER_TASK_MAX_RUNTIME: YES = 20m

Setting worker.taskMaxRuntime=null omits the variable entirely, so an operator can deliberately fall back to the application default.

Default

20m, chosen to give headroom over the measured 6m20 rather than sitting just above it. GitLab response time is the dominant factor and varies by instance, so a tight value would be fragile.

Verified

  • helm template renders on the worker only, and --set worker.taskMaxRuntime=45m overrides correctly
  • --set worker.taskMaxRuntime=null yields 0 occurrences
  • helm lint passes

Two things to check before merging

Chart version. Bumped 1.5.0 to 1.5.1, since v1.5.0 is already published as a GitHub release and the chart content is changing. I also moved appVersion in lockstep because every previous release in this repo keeps the two identical, though strictly the application version has not changed. Happy to split them or drop the bump if your release automation prefers to own it.

PMU run their own fork of this chart, so they need the same value added on their side. This PR fixes it for everyone downstream of ours.

Opening an analysis enumerates every governed project from GitLab, and that
enumeration is a single worker task. The worker watchdog kills the process if
any one task exceeds JOBS_WORKER_TASK_MAX_RUNTIME, which defaults to 3m in the
application. The chart had no way to set it, so every deployment inherited the
default.

On an estate of a few thousand projects that enumeration runs well past 3m: on
our test instance 3708 projects took 80 GitLab calls averaging 4.7s, about 6m20
in total. The worker is killed mid-list, the task is recovered and retried, and
the analysis is accepted but never leaves zero tasks. It is a restart loop with
no error surfaced to the user.

The value renders only on the worker deployment, since only the process started
with --worker reads it, and is omitted entirely when set to null so an operator
can fall back to the application default. Default 20m gives headroom over the
measured time rather than sitting just above it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WkEoFQP5bxWXS5qgkYxmu8
@thomasboni
thomasboni merged commit 483d7fb into main Sep 6, 2026
4 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.

1 participant