myxce/.claude/skills
Rongsong Shen 7f3237aee1
fix(xce-deploy-ha): stop a stale deploy's processes surviving a hand-typed cleanup mistake
A live 3-node HA cluster went into a repeated PreVote-failover storm
(term climbing, RDHUP loops, "scheduler not connected") even though
system load was low. Root cause: a hand-typed cleanup command had a
transposed-word typo (xce-ha-deploy vs. the real xce-deploy-ha path)
and silently killed nothing, leaving a full controller cluster alive.
A fresh deploy then bound a second, independent cluster to the exact
same ports, and the two clusters' vote traffic genuinely cross-talked
-- producing symptoms that looked like a real HA bug but weren't.

Two structural gaps let that one typo cascade this badly:

1. deploy-ha.sh had no pre-flight check that target ports were free --
   it would happily start a second Raft group on ports an existing one
   already held, instead of failing cleanly.
2. start.sh/start-all.sh already had a correct "already running" guard
   (reads $TOP/run/*.pid, checks kill -0), but cleanup.sh deleted those
   pidfiles unconditionally as part of state cleanup, with no check
   that the process each one pointed to was actually dead first --
   silently erasing the only signal that guard depends on.

Fixes, all live-verified end to end against real controller/worker/
scheduler/apiserver binaries:

- Added a port pre-flight check before any deploy state is created:
  refuses with the exact blocking PID/process if a target port is
  already listening.
- cleanup.sh now stops every live PID in $TOP/run/*.pid before
  removing any pidfile or state.
- Added stop-all.sh (generated alongside start.sh/cleanup.sh): the
  canonical, typo-proof way to stop everything a specific deploy
  started, since it reads that deploy's own tracked PIDs instead of
  matching process names/paths by hand.
- Found and fixed a related race while testing the above: start-all.sh
  didn't wait for worker/scheduler/apiserver to write their pidfiles
  before returning "done", so cleanup.sh/stop-all.sh run immediately
  after could orphan those two specifically -- the same zombie-process
  class this whole fix targets, via a narrower window instead of an
  operator typo. Added a short pidfile-appearance poll to close it.

SKILL.md updated to prefer a known deploy's own stop-all.sh over a
hand-typed kill command, document cleanup.sh's new stop-then-wipe
behavior, and add two Troubleshooting rows matching this incident
directly.

bug-1816.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
2026-09-15 14:04:16 +00:00
..
gitea-sync feat(tooling): add cc-sdd to Gitea sync skill 2026-07-23 04:29:06 +00:00
kiro-debug add kiro skills 2026-05-21 03:41:57 +00:00
kiro-discovery add kiro skills 2026-05-21 03:41:57 +00:00
kiro-impl add kiro skills 2026-05-21 03:41:57 +00:00
kiro-review add kiro skills 2026-05-21 03:41:57 +00:00
kiro-spec-batch add kiro skills 2026-05-21 03:41:57 +00:00
kiro-spec-design docs: general design-time cross-check against project invariant dimensions 2026-08-27 09:01:17 +00:00
kiro-spec-init docs(kiro): reconcile spec metadata, promote 3 new specs, fix template path 2026-08-16 11:02:06 +00:00
kiro-spec-quick docs(kiro): reconcile spec metadata, promote 3 new specs, fix template path 2026-08-16 11:02:06 +00:00
kiro-spec-requirements docs(kiro): reconcile spec metadata, promote 3 new specs, fix template path 2026-08-16 11:02:06 +00:00
kiro-spec-status add kiro skills 2026-05-21 03:41:57 +00:00
kiro-spec-tasks docs(kiro): reconcile spec metadata, promote 3 new specs, fix template path 2026-08-16 11:02:06 +00:00
kiro-steering docs(kiro): reconcile spec metadata, promote 3 new specs, fix template path 2026-08-16 11:02:06 +00:00
kiro-steering-custom docs(kiro): reconcile spec metadata, promote 3 new specs, fix template path 2026-08-16 11:02:06 +00:00
kiro-validate-design docs: general design-time cross-check against project invariant dimensions 2026-08-27 09:01:17 +00:00
kiro-validate-gap add kiro skills 2026-05-21 03:41:57 +00:00
kiro-validate-impl add kiro skills 2026-05-21 03:41:57 +00:00
kiro-verify-completion add kiro skills 2026-05-21 03:41:57 +00:00
weekly_report chore(specs): add scheduler-sim-eager-reconciliation spec, weekly report, cross-spec sequencing notes 2026-08-24 12:56:35 +00:00
xce-audit-invariants docs: formalize save/restore field-completeness as a standing invariant 2026-08-27 08:59:48 +00:00
xce-build feat(xce-build): default --jobs to a live-computed value when omitted 2026-09-15 09:19:55 +00:00
xce-changes feat(skills): add xce-changes skill for component-grouped CHANGES.md 2026-08-30 14:08:57 +00:00
xce-deploy-ha fix(xce-deploy-ha): stop a stale deploy's processes surviving a hand-typed cleanup mistake 2026-09-15 14:04:16 +00:00
xce-test-ha feat(xce-harness-component): xce-test-ha builds/checks harness explicitly 2026-09-14 06:57:08 +00:00
xce-test-multihost feat(xce-harness-component): xce-test-multihost builds/checks harness explicitly 2026-09-14 07:21:28 +00:00
xce-test-resources feat(xce-harness-component): xce-test-resources builds/checks harness explicitly 2026-09-14 07:29:23 +00:00