PRD 0043: sidecar pipe lifecycle cleanup #146

Merged
didericis merged 3 commits from prd-0043-sidecar-pipe-lifecycle into main 2026-06-02 11:53:15 -04:00
Collaborator

Closes #140.

PRD: https://gitea.dideric.is/didericis/bot-bottle/src/branch/prd-0043-sidecar-pipe-lifecycle/docs/prds/0043-sidecar-pipe-lifecycle.md

Summary

  • Explicitly close child stdout pipe file descriptors in the _Supervisor restart and shutdown paths
  • Enable ResourceWarning as a test error to catch any remaining leaks
  • No change to signal handling or exit-code contract from PRD 0034

Changes (1 commit)

  • docs/prds/0043-sidecar-pipe-lifecycle.md — add PRD 0043 (Draft)
Closes #140. PRD: https://gitea.dideric.is/didericis/bot-bottle/src/branch/prd-0043-sidecar-pipe-lifecycle/docs/prds/0043-sidecar-pipe-lifecycle.md ## Summary - Explicitly close child stdout pipe file descriptors in the `_Supervisor` restart and shutdown paths - Enable `ResourceWarning` as a test error to catch any remaining leaks - No change to signal handling or exit-code contract from PRD 0034 ## Changes (1 commit) - `docs/prds/0043-sidecar-pipe-lifecycle.md` — add PRD 0043 (Draft)
didericis approved these changes 2026-06-02 11:09:17 -04:00
didericis added 3 commits 2026-06-02 11:48:29 -04:00
Closes #140. In restart_daemon, the old process's stdout pipe was never
explicitly closed after p.wait() returned, leaking the fd until the
supervisor object was GC'd. Similarly, when the watch loop converged
(all children dead), no pipe was closed. Both paths now call
p.stdout.close() immediately after the process is confirmed exited.
Tests enforce this with warnings.simplefilter("error", ResourceWarning)
in TestSupervisor.setUp.
docs: mark PRD 0043 Active
test / unit (pull_request) Successful in 34s
test / integration (pull_request) Successful in 43s
test / unit (push) Successful in 34s
test / integration (push) Successful in 41s
4fdf354b4f
didericis force-pushed prd-0043-sidecar-pipe-lifecycle from 8ca1ede4ec to 4fdf354b4f 2026-06-02 11:48:29 -04:00 Compare
didericis merged commit 4fdf354b4f into main 2026-06-02 11:53:15 -04:00
didericis deleted branch prd-0043-sidecar-pipe-lifecycle 2026-06-02 11:53:15 -04:00
Sign in to join this conversation.