Skip to content

fix: allow workers to drain executions before shutdown - #332

Open
jacksonriding wants to merge 2 commits into
LibreChat-AI:mainfrom
jacksonriding:fix/drain-workers-before-shutdown
Open

jacksonriding wants to merge 2 commits into
LibreChat-AI:mainfrom
jacksonriding:fix/drain-workers-before-shutdown

Conversation

@jacksonriding

@jacksonriding jacksonriding commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

A worker currently forces exit after 30 seconds even though ordinary jobs can run for five minutes. Raising only the service timer would still leave Docker/Kubernetes free to kill it earlier, and the combined supervisor currently stops the sandbox before its worker drains.

Derive worker shutdown time from the existing execution/cleanup budget, retaining the longer hosted-app budget. Keep the API-only default at 30 seconds and support CODEAPI_SHUTDOWN_TIMEOUT_MS through the existing positive-integer parser, with protection against timer overflow.

Align the supplied deployment paths: Compose workers get 400 seconds; Helm worker pods derive stop grace from the configured job timeout plus 100 seconds, with an explicit override. Stop the combined container's worker before its sandbox. Bump the chart to 0.3.3.

Validation:

  • 29 shutdown/configuration tests pass on Bun 1.4.2.
  • Worker/sandbox shutdown and all three Compose configurations pass; the shutdown regression fails with the upstream supervisor order.
  • Helm lint and rendering pass for default, longer-job, and explicit-override budgets.
  • Release-versioning checks pass.
  • Service build completes with the existing three TypeScript warnings in unrelated code.

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