Skip to content

fix(plugins): bound discovery when apiserver stalls#1838

Closed
stephenlclarke wants to merge 1 commit into
apple:mainfrom
stephenlclarke:fix-plugin-discovery-timeouts
Closed

fix(plugins): bound discovery when apiserver stalls#1838
stephenlclarke wants to merge 1 commit into
apple:mainfrom
stephenlclarke:fix-plugin-discovery-timeouts

Conversation

@stephenlclarke

Copy link
Copy Markdown

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Plugin discovery can hang before root help or plugin dispatch completes when com.apple.container.apiserver is registered but not answering XPC requests. This affects paths such as container --help, container help, bare container, and container compose ....

Addresses #1459.

Related to #995, but this PR intentionally keeps a narrower scope:

  • fix(xpc): prevent startup hangs with proper timeout handling (#561) #995 also changes apiserver startup/default-network behavior and adds broader NetworkClient timeout policy.
  • This PR only bounds plugin discovery/help and fixes the shared XPCClient.send(... responseTimeout:) timeout primitive.
  • This PR keeps XPC clients reusable after a timed-out request; late replies are ignored by a single-resume gate instead of closing the connection.
  • This PR adds deterministic command-health and anonymous-XPC regression tests.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Validation:

  • swift test --disable-automatic-resolution --enable-code-coverage --filter 'ApplicationHealthTests|XPCClientTests|HelpCommandTests'
  • make swift-fmt-check
  • git diff --check

The focused coverage suite covers the new timeout/race behavior, root/default/help command paths, XPC timeout return, nil-route timeout messaging, normal XPC replies, and client reuse after timeout.

@stephenlclarke stephenlclarke marked this pull request as ready for review June 26, 2026 13:34
@stephenlclarke stephenlclarke marked this pull request as draft June 26, 2026 13:48
@stephenlclarke stephenlclarke force-pushed the fix-plugin-discovery-timeouts branch from 1de4489 to 4b8186f Compare June 26, 2026 13:52
@stephenlclarke stephenlclarke deleted the fix-plugin-discovery-timeouts branch June 27, 2026 20:51
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