Skip to content

fix(templates): run the Node image under tini so SIGTERM stops pods promptly - #5

Merged
MarshallOfSound merged 2 commits into
mainfrom
tini-init
Oct 22, 2026
Merged

MarshallOfSound merged 2 commits into
mainfrom
tini-init

Conversation

@claude

@claude claude Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Samuel Attard · Slack thread

This installs tini in the runtime stage of templates/Dockerfile.node and makes it the ENTRYPOINT, keeping the existing CMD. Node and probot install no SIGTERM handler, so when the app runs as PID 1 the kernel ignores the SIGTERM Kubernetes sends on shutdown, and every pod waits out the 30-second grace period and is then killed mid-request. With tini as PID 1 the signal reaches the app and the container stops in under a second. Because the app now exits right away, the node-web-app Deployment also waits 5 seconds before SIGTERM (a preStop sleep), so Envoy Gateway stops sending traffic to a pod before it shuts down during a rollout. The cronjob base now sets the job's command with args instead of command, because command replaced the image's entrypoint and cron pods ran without tini; its README examples changed to match. Review comments on the symbol-server and secret-service migrations caught the original problem, and the tini change is now on all six ionic migration PRs.


Generated by Claude Code

…romptly

Node installs no SIGTERM handler by default, so as PID 1 it ignored the
SIGTERM Kubernetes sends on shutdown and every pod waited out the 30s
grace period before being SIGKILLed. Install tini in the runtime stage
and use it as the ENTRYPOINT; the CMD is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe
@claude
claude Bot requested a review from a team as a code owner October 22, 2026 19:32
Comment thread templates/Dockerfile.node
Comment thread templates/Dockerfile.node
node-web-app: add a 5s preStop sleep (kubelet's built-in sleep action,
GA in Kubernetes 1.34; ionic-platform runs 1.34.6) so Envoy Gateway stops
routing to a terminating pod before tini forwards SIGTERM and Node exits.

cronjob: set the job's command via `args` instead of `command`, which
replaced the image ENTRYPOINT and skipped tini. Update the README patch
paths and the sh -c example, and the local example overlay, to match.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new blocking issues. 1 optional suggestion (a nit or a note on pre-existing code) was found and not posted. Nothing in this review needs a push before merging.

@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) October 22, 2026 19:42

@electron-faraday electron-faraday Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

faraday: this pull request passed the faraday/cage check via the 1h grant in .github/faraday.yml — a listed reviewer approved commit 133bc182 and the Claude Code Review check passed on it. This review is faraday's own approval of that commit so a required-approvals rule is satisfied; it does not count toward faraday's own tally.

@MarshallOfSound
MarshallOfSound merged commit 5fe23c0 into main Oct 22, 2026
7 checks passed
@MarshallOfSound
MarshallOfSound deleted the tini-init branch October 22, 2026 19:43
claude Bot pushed a commit to electron/unreleased that referenced this pull request Oct 22, 2026
Picks up electron/ionic-kit#5 (5s preStop sleep in kustomize/node-web-app).
Reusable deploy.yml workflow is unchanged between 07503ed and 5fe23c0.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe
claude Bot pushed a commit to electron/docs-reviewer that referenced this pull request Oct 22, 2026
Picks up electron/ionic-kit#5 (5s preStop sleep in kustomize/node-web-app).
Reusable deploy.yml workflow is unchanged between 07503ed and 5fe23c0.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe
claude Bot pushed a commit to electron/chrome-security-rss that referenced this pull request Oct 22, 2026
Picks up electron/ionic-kit#5 (5s preStop sleep in kustomize/node-web-app).
Reusable deploy.yml workflow is unchanged between 07503ed and 5fe23c0.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe
claude Bot pushed a commit to electron/symbol-server that referenced this pull request Oct 22, 2026
Picks up electron/ionic-kit#5 (5s preStop sleep in kustomize/node-web-app).
Reusable deploy.yml workflow is unchanged between 07503ed and 5fe23c0.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe
claude Bot pushed a commit to electron/trop that referenced this pull request Oct 22, 2026
Picks up electron/ionic-kit#5 (5s preStop sleep in kustomize/node-web-app).
Reusable deploy.yml workflow is unchanged between 07503ed and 5fe23c0.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe
MarshallOfSound pushed a commit to electron/unreleased that referenced this pull request Oct 22, 2026
* build: deploy to ionic

Add a Dockerfile, the ionic-kit build/deploy caller workflow and the
deploy/ kustomize overlay so the app can run on the ionic AKS platform
alongside Heroku. Add GET /healthz for the Kubernetes probes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

* fix(docker): run under tini so SIGTERM stops the pod promptly

The runtime CMD ran as PID 1 with no SIGTERM handler, so the kernel
dropped the SIGTERM Kubernetes sends on pod shutdown and every pod
waited out the 30s grace period before being SIGKILLed. tini runs as
PID 1 and forwards the signal; the CMD is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

* build: bump ionic-kit to 5fe23c0 for preStop drain

Picks up electron/ionic-kit#5 (5s preStop sleep in kustomize/node-web-app).
Reusable deploy.yml workflow is unchanged between 07503ed and 5fe23c0.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

---------

Co-authored-by: Claude <[email protected]>
MarshallOfSound pushed a commit to electron/chrome-security-rss that referenced this pull request Oct 22, 2026
* build: deploy to ionic

Add a Dockerfile, the ionic-kit build/deploy caller workflow and the
deploy/ kustomize config so the app can run on the ionic AKS platform
alongside Heroku. Adds GET /healthz for the probes, since / fetches
Google's feed on every hit.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

* fix(docker): run under tini so SIGTERM stops the pod promptly

The runtime CMD ran as PID 1 with no SIGTERM handler, so the kernel
dropped the SIGTERM Kubernetes sends on pod shutdown and every pod
waited out the 30s grace period before being SIGKILLed. tini runs as
PID 1 and forwards the signal; the CMD is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

* build: bump ionic-kit to 5fe23c0 for preStop drain

Picks up electron/ionic-kit#5 (5s preStop sleep in kustomize/node-web-app).
Reusable deploy.yml workflow is unchanged between 07503ed and 5fe23c0.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

---------

Co-authored-by: Claude <[email protected]>
MarshallOfSound pushed a commit to electron/trop that referenced this pull request Oct 22, 2026
* build: deploy to ionic

Add a Node 24 image (git in both stages, vendored build-tools carried
into the runtime stage, config.yml in the working dir), the ionic-kit
build/deploy caller workflow and the deploy/ kustomize overlay. Heroku
config stays in place until the cut-over.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

* fix(docker): run under tini so SIGTERM stops the pod promptly

The runtime CMD ran as PID 1 with no SIGTERM handler, so the kernel
dropped the SIGTERM Kubernetes sends on pod shutdown and every pod
waited out the 30s grace period before being SIGKILLed. tini runs as
PID 1 and forwards the signal; the CMD is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

* build: bump ionic-kit to 5fe23c0 for preStop drain

Picks up electron/ionic-kit#5 (5s preStop sleep in kustomize/node-web-app).
Reusable deploy.yml workflow is unchanged between 07503ed and 5fe23c0.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

* build: set COMMITTER_USER_NAME and scrape /metrics via the cluster Datadog agent

Carry over the remaining Heroku config: COMMITTER_USER_NAME=electron-bot
(values confirmed by @MarshallOfSound). Datadog needs no DD_API_KEY or
in-pod agent on ionic: the cluster DatadogAgent already collects container
logs, and the prometheus.io/* pod annotations let its prometheusScrape
feature pick up trop's prom-client /metrics.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ELojQikqpZ2KVGqjEeNwUe

---------

Co-authored-by: Claude <[email protected]>
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.

2 participants