|
| 1 | +<!-- version-type: minor --> |
| 2 | +# service |
| 3 | + |
| 4 | +<!-- |
| 5 | +FORMATTING GUIDE: |
| 6 | +
|
| 7 | +### Detailed Entry (appears first when merging) |
| 8 | +
|
| 9 | +Use h3 (###) and below for detailed entries with paragraphs, code examples, and lists. |
| 10 | +
|
| 11 | +### Simple List Items |
| 12 | +
|
| 13 | +- Simple changes can be added as list items |
| 14 | +- They are collected together at the bottom of each section |
| 15 | +
|
| 16 | +TIP: When multiple changelog drafts are merged, heading-based entries |
| 17 | +appear before simple list items within each section. |
| 18 | +--> |
| 19 | + |
| 20 | +## 🗑️ Deprecated |
| 21 | +<!-- PLACEHOLDER: Describe deprecated features. Double-check if they are annotated with a `@deprecated` jsdoc tag. --> |
| 22 | + |
| 23 | +## ✨ Features |
| 24 | + |
| 25 | +### Supervised service processes survive abrupt parent termination |
| 26 | + |
| 27 | +Managed services launched by `ProcessRunner.spawnCommand()` now run inside a small Node supervisor (started via `node -e`) instead of a bare shell. The supervisor polls the parent stack-craft process and, when the parent disappears without a graceful stop (`kill -9`, IDE force-stop, abrupt WSL exit, or a crash), tears down the entire child process tree. |
| 28 | + |
| 29 | +- On POSIX, the supervisor is the process-group leader and escalates SIGTERM → SIGKILL across the group, mirroring `ServiceLifecycleManager.shutdownAll()`. |
| 30 | +- On Windows, it uses `taskkill /T` (then `/F`) to walk and kill the descendant tree, since process groups are unavailable. |
| 31 | +- SIGTERM/SIGINT/SIGHUP from the parent are forwarded into the same kill cascade, so `killProcessGroup()` keeps working unchanged. |
| 32 | +- Grace and poll intervals are configurable via the `WATCHDOG_GRACE_MS` and `WATCHDOG_POLL_MS` environment variables (defaults: 5000 ms and 1000 ms). |
| 33 | + |
| 34 | +This prevents orphaned service processes from lingering when stack-craft itself goes away unexpectedly. |
| 35 | + |
| 36 | +## 🐛 Bug Fixes |
| 37 | +<!-- PLACEHOLDER: Describe the nasty little bugs that has been eradicated (fix:) --> |
| 38 | + |
| 39 | +## 📚 Documentation |
| 40 | +<!-- PLACEHOLDER: Describe documentation changes (docs:) --> |
| 41 | + |
| 42 | +## ⚡ Performance |
| 43 | +<!-- PLACEHOLDER: Describe performance improvements (perf:) --> |
| 44 | + |
| 45 | +## ♻️ Refactoring |
| 46 | +<!-- PLACEHOLDER: Describe code refactoring (refactor:) --> |
| 47 | + |
| 48 | +## 🧪 Tests |
| 49 | + |
| 50 | +- Updated `process-runner` spec coverage to assert that user commands are wrapped in the Node supervisor (parent pid + shell invocation) on both POSIX and Windows. |
| 51 | + |
| 52 | +## 📦 Build |
| 53 | +<!-- PLACEHOLDER: Describe build system changes (build:) --> |
| 54 | + |
| 55 | +## 👷 CI |
| 56 | +<!-- PLACEHOLDER: Describe CI configuration changes (ci:) --> |
| 57 | + |
| 58 | +## ⬆️ Dependencies |
| 59 | +<!-- PLACEHOLDER: Describe dependency updates (deps:) --> |
| 60 | + |
| 61 | +## 🔧 Chores |
| 62 | +<!-- PLACEHOLDER: Describe other changes (chore:) --> |
0 commit comments