Skip to content

[release/2.0] Respect client.WithTimeout option on connect#11536

Merged
AkihiroSuda merged 1 commit intocontainerd:release/2.0from
k8s-infra-cherrypick-robot:cherry-pick-11508-to-release/2.0
Mar 14, 2025
Merged

[release/2.0] Respect client.WithTimeout option on connect#11536
AkihiroSuda merged 1 commit intocontainerd:release/2.0from
k8s-infra-cherrypick-robot:cherry-pick-11508-to-release/2.0

Conversation

@k8s-infra-cherrypick-robot

This is an automated cherry-pick of #11508

/assign dmcgowan

Fix the gRPC client dialer not using the timeout passed by the
containerd client timeout option.

Commit 63b4688 replaced the usage of deprecated `grpc.DialContext`
with `grpc.NewClient`.

However, the `dialer.ContextDialer` relied on the context deadline to
propagate the timeout:

https://github.com/containerd/containerd/blob/388fb336b0a458e2cf64212072743e622a3f44c7/vendor/google.golang.org/grpc/clientconn.go#L216

This assumption is now broken, because `grpc.NewClient` doesn't do any
initial connection and defers it to the first RPC usage.

This commit passes the timeout via the `MinConnectTimeout` grpc
connection param, which will be applied to **every** connection attempt
(not just the first).

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@k8s-ci-robot
Copy link

Hi @k8s-infra-cherrypick-robot. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@dmcgowan dmcgowan changed the title [release/2.0] client: Respect client.WithTimeout option [release/2.0] Respect client.WithTimeout option on connect Mar 13, 2025
@djdongjin
Copy link
Member

/ok-to-test

@github-project-automation github-project-automation bot moved this from Needs Triage to Review In Progress in Pull Request Review Mar 14, 2025
@AkihiroSuda AkihiroSuda merged commit e9989a2 into containerd:release/2.0 Mar 14, 2025
58 checks passed
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in Pull Request Review Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants