8000 fix(minimald): log a requested session teardown at info by norrietaylor · Pull Request #1931 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimald): log a requested session teardown at info - #1931

Merged
norrietaylor merged 1 commit into
mainfrom
fix/minimald-requested-teardown-reap-log
Oct 5, 2026
Merged

norrietaylor merged 1 commit into
mainfrom
fix/minimald-requested-teardown-reap-log

Conversation

@norrietaylor
Copy link
Copy Markdown
Member

What

Every min session destroy wrote a guest-log line that cannot be told apart from an OOM kill:

WARN session process reaped after pty/step error abnormal=true exit_reason="container received signal SIGKILL"

A destroy sends Message::Kill. Host::step logs session host killed on request at info, SIGKILLs the leader, and returns Err. Host::mainloop then takes the step().is_err() branch, reaps the process, and always logged the reap at warn!. hakoniwa reports the container SIGKILL with no exit code, so the line also carried abnormal=true.

That branch already knows whether the end was requested: pending_pty_err is None exactly when step erred on Message::Kill. Nothing else returns Err from step without first stashing a pty error.

Change

  • mainloop records requested = pending.is_none() before take_if can empty pending.
  • A requested teardown logs the reap at info! as session process reaped after requested teardown, with the same fields.
  • Every other death keeps the existing warn! line, so an OOM kill or an external SIGKILL still stands out.
  • ExitReason::is_abnormal and everything shown to the user are unchanged. Only the daemon log line changes.

Tests

Two unit tests in crates/minimald/src/session_host/tests.rs, both driving the mock host:

  • a_requested_kill_logs_its_reap_at_info: a Message::Kill produces one reap line, at INFO, with the requested-teardown message.
  • an_unrequested_kill_still_warns_abnormal: an external SIGKILL of the live shell produces one reap line, at WARN, with abnormal=true.

Refs gominimal/inbox#838

A destroy SIGKILLs the session leader, and the reap that follows reported
the same abnormal SIGKILL an OOM kill does, at warn. Every destroy wrote a
line indistinguishable from a real unexpected death.

The reap branch in Host::mainloop already knows whether the end was asked
for: no pty error is stashed exactly when step erred on Message::Kill. Log
that reap at info as "session process reaped after requested teardown",
with the same fields, and keep the warn for every other death.

Refs gominimal/inbox#838
@norrietaylor
norrietaylor requested a review from a team as a code owner October 4, 2026 04:36
@coderabbitai
coderabbitai Bot commented Oct 4, 2026
Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 37 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 1b7430ce-e734-403d-9f09-bc64d797e3b4
📥 Commits

Reviewing files that changed from the base of the PR and between 588fbde and 9834d8a.

📒 Files selected for processing (2)
  • crates/minimald/src/session_host.rs
  • crates/minimald/src/session_host/tests.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@minimal-foundry
minimal-foundry Bot commented Oct 4, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at 9834d8a4c6ba.

Nothing to do.

Clobber: none: git log on both files shows the PR's head commit atop a recent unrelated merge, and nothing the change touches was recently fixed or reverted.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 4, 2026
@norrietaylor
norrietaylor merged commit 2a7f6d2 into main Oct 5, 2026
35 checks passed
@norrietaylor
norrietaylor deleted the fix/minimald-requested-teardown-reap-log branch October 5, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0