Skip to content

Docker client 'defaultTimeout' not working #416

@paulb2015

Description

@paulb2015

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 );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions