Skip to content

Shutdown grace (initd retry) and CI hardening - #14

Merged
SDNick484 merged 4 commits into
mainfrom
audit/shutdown-retry-and-ci-hardening
Nov 10, 2026
Merged

SDNick484 merged 4 commits into
mainfrom
audit/shutdown-retry-and-ci-hardening

Conversation

@SDNick484

@SDNick484 SDNick484 commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Part of the mcp-server-shared audit (SDNick484/mcp-server-shared#16), items C1 and C2. Three parts:

1. initd: retry="SIGTERM/15/SIGKILL/5". supervise-daemon's default stop schedule is SIGTERM/5. This
server's shutdown: usually about 2 s; worst case unbounded in our code: TVs stop one at a time, each up to 5 s for its task plus aiowebostv's WebSocket close (aiohttp's own 10 s).

Flag: with several TVs, or one that stops answering mid-shutdown, this can pass 15 s. That wants the per-TV stops gathered and the disconnect bounded, not a longer retry. Not in this PR.

2. CI hardening

  • permissions: contents: read for the whole workflow
  • .github/dependabot.yml: github-actions and pip, weekly on Monday, grouped (one PR each)
  • concurrency: one run per branch and event; only pull_request runs cancel, so a push to main can't
    cancel the weekly scheduled --check --latest
  • timeout-minutes on every job: 15 for test/alpine/docker/build (about 2 min today), 10 for the rest
  • every action pinned to the commit its moving tag pointed at today, with the exact version as a comment (no
    behaviour change)

3. shared-drift calls mcp-server-shared's reusable workflow (SDNick484/mcp-server-shared#30) instead of carrying its own copy: uses: SDNick484/mcp-server-shared/.github/workflows/shared-drift.yml@5f9b824… # v0.1.1. Same checks on the same events (--check always, --check --latest on schedule and manual runs), still run with this repo's own sync_shared.py. Dependabot's github-actions updates bump the pin like any action.

Deploy

install -m 0755 deploy/alpine/mcp-server-webos.initd /etc/init.d/mcp-server-webos
rc-service mcp-server-webos restart

supervise-daemon reads retry when the service starts (it's passed as --retry at start and stored), so
the restart that installs the file still stops on the old 5 s schedule; every stop after uses the new one.
CI changes need no deploy step.

Test plan

  • Every workflow parses as YAML and every job has timeout-minutes
  • Each pinned SHA is what the old tag (@v7, @v8, @release/v1) resolves to today
  • retry handling checked against OpenRC's supervise-daemon.sh/supervise-daemon.c
  • This PR's CI run (exercises the pins, timeouts and concurrency expression)
  • After deploy: rc-service <svc> restart twice; the second stop logs no SIGKILL

🤖 Generated with Claude Code

SDNick484 and others added 4 commits November 10, 2026 12:01
supervise-daemon's default stop schedule is SIGTERM/5: SIGKILL five
seconds after SIGTERM. That covers this server's usual shutdown but
leaves no margin for a slow one, and SIGKILL skips the lifespan
teardown. The comment above the setting in its initd gives the
worst case.

supervise-daemon takes the schedule when the service starts, so the
restart that installs the file still stops on the old one.

Refs SDNick484/mcp-server-shared#16

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

- permissions: contents: read for the whole workflow (jobs only read the checkout)
- concurrency: one run per branch and event; only PR runs cancel, so a
  push to main can't cancel the weekly --latest drift check
- timeout-minutes on every job: 15 for test/alpine/docker/build (about
  2 minutes today), 10 for the rest
- every action pinned to the commit its tag pointed at, version as a
  comment, so a moved tag can't change what runs
- .github/dependabot.yml: github-actions and pip, weekly on Monday, grouped

The shared-drift job moves to mcp-server-shared's reusable workflow in a
follow-up commit, once that repo tags v0.1.0.

Refs SDNick484/mcp-server-shared#16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inline job becomes `uses: SDNick484/mcp-server-shared/.github/
workflows/shared-drift.yml@<SHA> # v0.1.0`. Same checks on the same
events: --check always, --check --latest on schedule and
workflow_dispatch, still run with this repo's own sync_shared.py. The
workflow, its action pins, timeout and concurrency now live in one place
instead of being copied here.

The ref is pinned to the commit v0.1.0 points at, with the tag as a
comment, so Dependabot's github-actions updates bump it like an action.

Refs SDNick484/mcp-server-shared#16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The workflow file is the same at v0.1.0 and v0.1.1; this only moves the
pin to the tag the shared files are synced to, so Dependabot doesn't
open a bump for it straight away.

Refs SDNick484/mcp-server-shared#16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SDNick484
SDNick484 marked this pull request as ready for review November 10, 2026 22:45
@SDNick484
SDNick484 merged commit 7f9eb69 into main Nov 10, 2026
6 checks passed
@SDNick484
SDNick484 deleted the audit/shutdown-retry-and-ci-hardening branch November 10, 2026 23:41
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