Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker client 'defaultTimeout' not working #416

Closed
paulb2015 opened this issue Sep 11, 2019 · 1 comment · Fixed by #487
Closed

Docker client 'defaultTimeout' not working #416

paulb2015 opened this issue Sep 11, 2019 · 1 comment · Fixed by #487

Comments

@paulb2015
Copy link

Using the following code, I would expect an exception to be raised in 5 seconds. Instead I am getting a OperationCanceledException at 20 seconds.

If I remove the defaultTimeout argument from the DockerClientConfiguration constructor, I no longer get an OperationCanceledException, but I do get a HttpRequestException after 20 seconds.

No matter what I change, an exception is always raised at 20 seconds. This is the code I am using (the IP address will be set to a host that is offline/unavailable).

Using Docker.DotNet 3.125.2 / .Net Core 2.2.

var client = new DockerClientConfiguration( new Uri( $"http://X.X.X.X:2375" ), defaultTimeout: TimeSpan.FromSeconds( 5 ) ).CreateClient();

var containers = await client.Containers.ListContainersAsync( new ContainersListParameters
{
	All = true
},
default );
@yurii-pelekh
Copy link
Contributor

Hi! I've created PR for that #466

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 a pull request may close this issue.

2 participants