-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add timeouts, cleanup #1336
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
Add timeouts, cleanup #1336
Conversation
| * @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 { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
48d1fcd to
3a8140b
Compare
3a8140b to
ce1fe66
Compare
| private DockerClientConfig dockerClientConfig; | ||
|
|
||
| protected Integer connectTimeout; | ||
| protected Integer readTimeout; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
This change is