Change docker http client to use handlers instead of results to avoid leaving open connections #232
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The http client was not correctly used which was leaving connections open not being able to reuse them, which caused at some point to reach the max connections per route.
We faced this particular issue when trying to build 2 images with 2 tags each: since the default limit of connections per route host is 2 (when using unix socket, not https since https has a hardcoded config of 10 connections per route host) when we tried to build the images the plugin was getting stuck trying to get more connections.
The change consists mainly in changing existing httpClient execute using result as return with proper ResponseHandlers so http client library automatically closes httpResponse s to release open connections.