You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(apps): stop apps gracefully within their declared drain timeout #651
Apps declare resources.drainTimeoutMs (Monitoring: 2000), but the platform never reads it.
Stopping an app sends SIGKILL to its process group at once (core/src/app_ipc/process.rs:373-384). There is no SIGTERM in app_ipc or app_manager, and the launch frame (core/src/app_manager/runtime.rs:308-318) carries only startupTimeoutMs and processLimit.
Apps cannot finish in-flight requests, flush outboxes or close transactions on update, stop or uninstall.
App stdout and stderr go to /dev/null (process.rs:317-318), so a crashing app leaves no trace for the Owner.
Proposal
Pass drainTimeoutMs to the broker. On stop, send SIGTERM, wait up to the declared timeout, then SIGKILL the process group.
Keep the last 64 KiB of stderr per generation in memory and show it to the Owner after a crash.
Decision (2026-12-01)
Keep a bounded crash log: the last 64 KiB of stderr per generation, in memory only, readable only by the Owner, dropped on purge. stdout stays discarded.
Acceptance
Test: an app that handles SIGTERM exits cleanly within its drain timeout; an app that ignores it is killed after the timeout.
Test: after a crash the Owner sees the last stderr output, other users do not, and purge removes it.
Activity