Skip to content

πŸ› fix: postbox install waits for bootout, and status counts the daemon's open files - #89

Merged
hadees merged 1 commit into
mainfrom
fix/postbox-reload
Oct 2, 2026
Merged

hadees merged 1 commit into
mainfrom
fix/postbox-reload

Conversation

@hadees

@hadees hadees commented Sep 29, 2026

Copy link
Copy Markdown
Owner

What

The postbox daemon stopped answering with RESOURCE_BUSY / "Too many open files". Two causes:

  • am 0.3.36 leaks sqlite handles on its store. The eda-tools session found 234 of 258 handles open after five days.
  • This machine's LaunchAgent predated the 4096 limit (aa61cfd), so it was still on launchd's default of 256.

Nothing warned before it failed.

  • postbox status now prints a files: line: open handles against the limit in the installed plist. It names a plist that predates the limit and warns past 80%.
  • postbox install now waits for launchctl bootout to finish before bootstrap. Rerunning install to pick up the limit failed with "Bootstrap failed: 5: Input/output error" and left the job unloaded. Bootout returns before launchd has torn the job down, and the bootstrap landed in that window.

Verified

  • bats tests/postbox.bats: 53 pass, including 2 new tests (bootout wait ordering; files line with current, over-80% and stale-plist cases).
  • Live postbox status on this machine: files: 76 open of 4096. That's up from 32 fifteen minutes earlier, so the leak is still active.
  • Upstream report of the leak to the am project: not filed.

πŸ€– Generated with Claude Code

…n's open files

The postbox daemon stopped answering (RESOURCE_BUSY, "Too many open
files") because `am` 0.3.36 leaks sqlite handles on its store β€” 234 of
258 open after five days β€” and this machine's LaunchAgent predated the
4096 limit, so it still ran on launchd's 256. Nothing said so: status
reported the daemon loaded and answering right up to the failure.

`status` now prints open handles against the limit the installed plist
actually carries, names a plist that predates the limit, and warns past
80%. And rerunning `postbox install` to pick the limit up failed with
"Bootstrap failed: 5: Input/output error", leaving nothing loaded:
bootout returns before launchd has torn the job down, and the bootstrap
landed in that window. It now waits (up to 5 s) for the job to be gone.

Reported by the eda-tools session over postbox.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@hadees hadees self-assigned this Sep 29, 2026
@hadees
hadees merged commit 911d71f into main Oct 2, 2026
5 checks passed
@hadees
hadees deleted the fix/postbox-reload branch October 2, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant