[Fix] Do not close all TCP connections on an HTTP error #1180
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.
What changes are proposed in this pull request?
Closing the TCP pool on every error is unnecessary. The function was meant to be used for http clients that are short lived to avoid leaking resources (ref: golang/go#26563). For the Go SDK, the HTTP client is long-lived, and thus, there's no reason to proactively close the TCP connection pool on errors.
By default, the HTTP protocol maintains the health of its TCP connections (keep-alive messages) and the Go HTTP client automatically closes connections that have been idle for too long based on a timeout.
How is this tested?
Manually used this in a Databricks CLI binary and verified that the commands still work.
NO_CHANGELOG=true