Skip to content

Reap completed exec host state in the Linux runtime helper - #2060

Open
rogerneal wants to merge 1 commit into
apple:mainfrom
rogerneal:fix/2057-reap-completed-exec
Open

Reap completed exec host state in the Linux runtime helper#2060
rogerneal wants to merge 1 commit into
apple:mainfrom
rogerneal:fix/2057-reap-completed-exec

Conversation

@rogerneal

@rogerneal rogerneal commented Aug 3, 2026

Copy link
Copy Markdown

Summary

  • ExitMonitor.track now drops callback/task entries after the exit path finishes, so completed work does not retain host state forever.
  • RuntimeService reaps per-exec processes / waiters on exit, failed start, and container cleanup. Late wait still works via a compact completedExits cache when no waiter was present yet.
  • Failed createProcess registration and failed startExecProcess also reap instead of leaving orphaned entries.

Fixes #2057

Test plan

Tested

  • swift test --filter ExitMonitorTests (3/3 passed)
    • releases entries after successful exit
    • releases entries after WaitHandler failure
    • 200 sequential track/exit cycles still allow re-registration
  • Existing MultiWriterTests still compile against RuntimeService changes

Not tested

  • Full long-lived container-runtime-linux malloc growth repro with thousands of container machine run ... /usr/bin/true (needs installing this build into a running daemon session and measuring helper allocations)
  • Detached-exec path under allocation profiling

Drop ExitMonitor bookkeeping after exit and remove per-exec process and
waiter entries so long-lived container-runtime-linux helpers do not grow
with every finished command.
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.

[Bug]: completed exec state is retained in container-runtime-linux

1 participant