Skip to content

sdk: Keep dependency callbacks usable during extension Shutdown - #15

Open
vvoland wants to merge 1 commit into
moby:mainfrom
vvoland:shutdown-call
Open

vvoland wants to merge 1 commit into
moby:mainfrom
vvoland:shutdown-call

Conversation

@vvoland

@vvoland vvoland commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Close the callback connection after Shutdown returns.

Out-of-process extensions could not call their dependencies from a Shutdown hook.
ListenWithIO closed the callback connection before running Shutdown, so any call failed with "grpc: the client connection is closing", even though the host keeps serving dependencies until the extension process exits.

@vvoland vvoland self-assigned this Nov 5, 2026
@vvoland
vvoland requested a balanced review from Copilot November 18, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Shutdown-call assertion fails on Windows because interrupt signaling is unsupported, causing the extension to be killed before its Shutdown hook runs.

1 open issue
What changed in this PR

This PR keeps SDK dependency callbacks available during extension shutdown by closing the callback connection after the Shutdown hook returns.

Changes:

  • Move callback connection cleanup after Shutdown.
  • Extend the greeter dependency fixture to call its dependency during both Init and Shutdown.
  • Add an integration assertion that the shutdown dependency call reaches the host.
File Description
testdata/​greeterdep/​greeterdep.go Retain the resolver and call the greeter dependency during Shutdown.
testdata/​greeterdep/​cmd/​greeterdep/​main.go Update the command comment to describe shutdown behavior.
sdk/​serve.go Keep the callback connection open until Shutdown returns.
host/​dependency_test.go Check that the host receives the shutdown dependency call.

Review effort: Balanced

Comment thread host/dependency_test.go Resolved
Close the callback connection after Shutdown returns.

Out-of-process extensions could not call their dependencies from a
Shutdown hook.
ListenWithIO closed the callback connection before running Shutdown, so
any call failed with "grpc: the client connection is closing", even
though the host keeps serving dependencies until the extension process
exits.

Signed-off-by: Paweł Gronowski <git@grono.dev>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the change preserving dependency callbacks through extension shutdown.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@vvoland
vvoland requested a review from thaJeztah November 20, 2026 21:30
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.

2 participants