Skip to content

Conversation

@KostyaSha
Copy link
Member

@KostyaSha KostyaSha commented Mar 3, 2020

This change is Reviewable

@KostyaSha KostyaSha requested a review from bsideup March 3, 2020 22:31
* @see https://docs.docker.com/engine/reference/api/docker_remote_api_v1.21/#attach-to-a-container
* @see https://docs.docker.com/engine/reference/api/docker_remote_api_v1.21/#exec-start
*/
public class NettyDockerCmdExecFactory extends AbstractDockerCmdExecFactory implements DockerCmdExecFactory {
Copy link
Member Author

Choose a reason for hiding this comment

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

redundant implements

clientBuilder.connectTimeout(connectTimeout, TimeUnit.MILLISECONDS);
}

clientBuilder.retryOnConnectionFailure(true);
Copy link
Member Author

@KostyaSha KostyaSha Mar 3, 2020

Choose a reason for hiding this comment

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

questionable, better move to option?

private DockerClientConfig dockerClientConfig;

protected Integer connectTimeout;
protected Integer readTimeout;
Copy link
Member

Choose a reason for hiding this comment

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

readTimeout is wrong since there can be long living connections. The correct approach would be to use timeouts/deadlines when executing the commands

Copy link
Member Author

@KostyaSha KostyaSha Mar 4, 2020

Choose a reason for hiding this comment

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

For library that doesn't matter, you can set any timeouts on your app side.

Copy link
Member

Choose a reason for hiding this comment

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

you should not be setting the default read timeout here. Some operations last minutes or even hours. The callee should set the timeouts at the use site

@KostyaSha KostyaSha added this to the 3.2.0-rc6 milestone Mar 7, 2020
@KostyaSha KostyaSha merged commit 978ac88 into docker-java:master Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants