0.9.0: reboot can still clear session when SIGHUP becomes exit code 1
Is this a reproducible bug?
- I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
- I reproduced this bug on the version and environment reported below using the exact steps provided.
Current behavior
Completely Lost all my workspaces/tabs/panes/agents (34 panes across 9 workspaces were terminated).
After a Linux host reboot, Herdr lost the complete saved layout. session.json was explicitly cleared, and the next start created an empty default workspace.
This appears to be an uncovered variant of #3415. Most pane exits were reported without a signal:
pane child exited pane_id=18 status="ExitStatus { code: 1, signal: None }" pane child exited pane_id=30 status="ExitStatus { code: 1, signal: None }" ... session saved event="persist.save" outcome="ok" workspaces=9 server shutdown initiated completing server shutdown session cleared event="persist.clear" outcome="ok" path=/home/user/.config/herdr/session.json
The underlying pane sessions separately reported SIGHUP, suggesting a shell or wrapper translated the signal into exit code 1.
In 0.9.0, classify_child_exit only treats exits with status.signal().is_some() as interrupted. Exit code 1 is therefore treated as a normal pane closure, allowing the session to shrink to zero and be cleared.
The same classification remains in 0.9.1.
Expected behavior
Host shutdown must preserve the last valid session snapshot regardless of whether pane processes report a signal or translate it into a normal nonzero exit code.
session.json should never be cleared merely because pane processes exit immediately before the server receives its shutdown signal
Reproduction
tbh I can't tell for sure, but given the importance of this bug, I think it's worth looking into. Agent:
Use a disposable machine/session because this may delete all Herdr state.
- Install Herdr 0.9.0.
- Start Herdr and create multiple workspaces, tabs, and panes.
- Start agents in some panes.
- Confirm ~/.config/herdr/session.json exists.
- Run:
herdr update
- Wait for the update and server shutdown to complete.
- Start Herdr again.
Impact
Completely Lost all my workspaces/tabs/panes/agents (34 panes across 9 workspaces were terminated).
Environment
- Herdr server at time of failure: 0.9.0
- Host: Linux
- Trigger: host reboot
- Related issue: #3415
- Related fix: #3418
Source: herdrdev/herdr