Skip to content

[Fix] Do not close all TCP connections on an HTTP error #1180

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

Merged
merged 2 commits into from
Mar 20, 2025

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Mar 18, 2025

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

@shreyas-goenka shreyas-goenka changed the base branch from main to dev/sdk-mod March 18, 2025 17:04
@shreyas-goenka shreyas-goenka changed the title Do not close all TCP connections on an HTTP error [Fix] Do not close all TCP connections on an HTTP error Mar 18, 2025
@shreyas-goenka shreyas-goenka marked this pull request as ready for review March 18, 2025 17:09
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-go

Inputs:

  • PR number: 1180
  • Commit SHA: 7cefc88d6aa8ec9c03c65a04ba232046c54b6850

Checks will be approved automatically on success.

@renaudhartert-db renaudhartert-db added this pull request to the merge queue Mar 20, 2025
Merged via the queue into dev/sdk-mod with commit 1bfb476 Mar 20, 2025
16 checks passed
@renaudhartert-db renaudhartert-db deleted the copy-do-not-close-connection-2 branch March 20, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants