Skip to content

[feat][ROS] Let a worker set its termination grace period - #452

Draft
njdelima wants to merge 2 commits into
mainfrom
njdelima/retoolos-worker-termination-grace
Draft

njdelima wants to merge 2 commits into
mainfrom
njdelima/retoolos-worker-termination-grace

Conversation

@njdelima

@njdelima njdelima commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Problem

Worker pods always get Kubernetes' default 30-second termination grace. The RetoolOS worker needs longer than that to let in-flight agent turns finish during a rollout, but the chart gives no way to raise it.

Fix

  • Each worker's values block (for example retoolos.worker) accepts an optional terminationGracePeriodSeconds.
  • When it's unset nothing is rendered, so existing installs don't change.
  • The RetoolOS values document it next to RETOOLOS_TEMPORAL_WORKER_SHUTDOWN_GRACE_TIME, the worker setting it has to exceed. That setting ships in an upcoming Retool release.

Tests

.github/test_worker_termination_grace.py renders the chart and checks three cases:

  • unset renders nothing;
  • a value is applied to the RetoolOS worker;
  • it doesn't leak to the other workers.

🤖 Generated with Claude Code

Add an optional terminationGracePeriodSeconds under each worker's values
block (for example retoolos.worker). When unset nothing is rendered and pods
keep the Kubernetes default of 30 seconds, so existing installs don't change.

The RetoolOS worker needs this to let in-flight agent turns finish during a
rollout: its shutdown grace (RETOOLOS_TEMPORAL_WORKER_SHUTDOWN_GRACE_TIME)
can only be raised as far as Kubernetes waits before killing the pod.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; the previous zero-value issue is fixed.

Reviews (2) · Last reviewed commit: "Keep a worker's terminationGracePeriodSe..." · Reviewed by Greptile

Comment thread charts/retool/templates/_workers.tpl Resolved
`with` treats 0 as empty, so the field was dropped and the pod got the 30 s
default. Check for the key instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@njdelima

njdelima commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

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