Skip to content

fix: align managed agent shutdown timing - #40

Merged
rung merged 4 commits into
mainfrom
agent/align-agent-shutdown-timeout
Aug 8, 2026
Merged

rung merged 4 commits into
mainfrom
agent/align-agent-shutdown-timeout

Conversation

@rung

@rung rung commented Aug 8, 2026

Copy link
Copy Markdown
Member

Refs cicd-sensor/cicd-sensor#143
Pairs with cicd-sensor/cicd-sensor#148.

Why

The Action-managed Agent unit used TimeoutStopSec=5s, while the Agent needs a longer grace period to flush manager output during shutdown. systemd could therefore send SIGKILL before the Agent finished its own drain.

The Action owns both the Agent command line and its transient systemd unit, so those deadlines should be configured together.

What

  • pass --shutdown-grace 20s to Action-managed Agents
  • increase the Agent unit's TimeoutStopSec to 30s
  • keep the Docker proxy timeout at 5s
  • test that the supervisor timeout remains greater than the Agent grace period
  • update the checked-in dist/main bundle

Verification

  • npm run lint
  • npm test
  • npm run check-dist
  • 10-job GitHub-hosted verification using the exact Agent PR #148 and Action commits:
    • GitHub Actions: 10/10 succeeded
    • Manager summary logs: 10/10
    • Manager detection logs: 10/10
    • runtime event logs exactly matched events_total: 9/10

The remaining incomplete runtime tail shows that timeout alignment alone does not guarantee every streaming record under concurrent teardown. This PR fixes the Action's supervisor deadline mismatch; Agent-side project-result/finalization behavior remains owned by #148.

@rung

rung commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

CI note: the source checks and all 23 tests pass. The job currently fails only at npm audit because the unchanged main lockfile now reports brace-expansion (high) and undici (moderate) advisories. I am keeping that dependency/security update separate from this shutdown-timing change.

@rung
rung force-pushed the agent/align-agent-shutdown-timeout branch from a33b4aa to e23a562 Compare August 8, 2026 18:15
@rung
rung merged commit f18ea39 into main Aug 8, 2026
1 check 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