Skip to content

server: tolerate failed gRPC plugins when starting listeners#13363

Merged
dmcgowan merged 1 commit into
containerd:mainfrom
AkihiroSuda:fix-13362-rootless-grpc-server
May 12, 2026
Merged

server: tolerate failed gRPC plugins when starting listeners#13363
dmcgowan merged 1 commit into
containerd:mainfrom
AkihiroSuda:fix-13362-rootless-grpc-server

Conversation

@AkihiroSuda

Copy link
Copy Markdown
Member

The grpc, grpc-tcp, and ttrpc server plugins enumerated their services through ic.GetByType, which short-circuits on the first plugin whose Instance() returned an error. A single failed gRPC plugin (e.g. CRI under rootless, which cannot watch /etc/cni/net.d) therefore prevented the server plugins from initialising, leaving /run/containerd/containerd.sock uncreated.

Iterate the plugin set directly and skip plugins that failed to initialise, restoring the pre-c15ec2485 behaviour where the listener is still created and only the failed services are missing.

Fixes: c15ec24 ("Add server plugins for grpc and ttrpc")
Fixes: #13362


Note: used Claude Code

The grpc, grpc-tcp, and ttrpc server plugins enumerated their services
through ic.GetByType, which short-circuits on the first plugin whose
Instance() returned an error. A single failed gRPC plugin (e.g. CRI
under rootless, which cannot watch /etc/cni/net.d) therefore prevented
the server plugins from initialising, leaving /run/containerd/containerd.sock
uncreated.

Iterate the plugin set directly and skip plugins that failed to
initialise, restoring the pre-c15ec2485 behaviour where the listener
is still created and only the failed services are missing.

Fixes: c15ec24 ("Add server plugins for grpc and ttrpc")
Fixes: containerd#13362

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR restores tolerant listener startup behavior for the gRPC and TTRPC server plugins by avoiding InitContext.GetByType(...), which aborts service enumeration on the first plugin that failed initialization. As a result, the main gRPC listener (e.g. /run/containerd/containerd.sock) can still be created even when some gRPC service plugins (like CRI in certain rootless setups) fail to initialize.

Changes:

  • Update gRPC server plugin to iterate the full plugin set and skip plugins whose Instance() returned an error, instead of failing server initialization.
  • Apply the same tolerant iteration approach to the gRPC TCP server plugin and the TTRPC server plugin.
  • Remove now-unused errors imports from the affected files.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
plugins/server/grpc/plugin.go Enumerates gRPC service plugins without short-circuiting on initialization errors, allowing the gRPC/grpc-tcp listeners to still start.
plugins/server/ttrpc/plugin.go Enumerates TTRPC/GRPC plugins directly and skips failed instances so the TTRPC server can still start when some services fail.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@haytok haytok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, Thanks!

@ChengyuZhu6 ChengyuZhu6 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@cpuguy83 cpuguy83 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems fine to fix the problem, but I'm wondering if we can add a new getter that is an iterator where the caller can choose what to do.

@AkihiroSuda AkihiroSuda requested a review from dmcgowan May 12, 2026 17:01
@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review May 12, 2026
@dmcgowan

Copy link
Copy Markdown
Member

This seems fine to fix the problem, but I'm wondering if we can add a new getter that is an iterator where the caller can choose what to do.

Yeah, we should have a way to handle that. The expected way to enforce plugin availability is the required plugins field, not erroring in places like this.

@dmcgowan dmcgowan added this pull request to the merge queue May 12, 2026
@AkihiroSuda

Copy link
Copy Markdown
Member Author

/cherry-pick release/2.3

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@AkihiroSuda: once the present PR merges, I will cherry-pick it on top of release/2.3 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release/2.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Merged via the queue into containerd:main with commit ccfcb15 May 12, 2026
58 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review May 12, 2026
@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@AkihiroSuda: new pull request created: #13390

Details

In response to this:

/cherry-pick release/2.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@austinvazquez austinvazquez added cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch and removed cherry-pick/2.3.x Change to be cherry picked to release/2.3 labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/rootless cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch priority/P0 size/M

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[v2.3.0-rc.0 regression] rootless: "/run/containerd/containerd.sock": no such file or directory

9 participants