Skip to content

Fix: change default HTTP timeout to 60s#1301

Merged
shreyas-goenka merged 3 commits into
mainfrom
fix/timeout
Oct 6, 2025
Merged

Fix: change default HTTP timeout to 60s#1301
shreyas-goenka merged 3 commits into
mainfrom
fix/timeout

Conversation

@shreyas-goenka

@shreyas-goenka shreyas-goenka commented Oct 5, 2025

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

This PR fixes the default configuration for HTTP timeout. A couple of months ago we increased the timeout to 60s, but that was a no-op because of this line that sets it to 30 seconds.

I caught it after noticing a couple of request timed out after 30s of inactivity during testing.

How is this tested?

Existing unit test.

NO_CHANGELOG=true

@github-actions

github-actions Bot commented Oct 5, 2025

Copy link
Copy Markdown

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: 1301
  • Commit SHA: 96852e1fcc63795170ebd24eda11ea7c6c05e42c

Checks will be approved automatically on success.

@shreyas-goenka shreyas-goenka marked this pull request as ready for review October 5, 2025 18:39
Comment thread httpclient/api_client.go

func NewApiClient(cfg ClientConfig) *ApiClient {
// Set defaults for config values that are not set.
cfg.HTTPTimeout = time.Duration(orDefault(int(cfg.HTTPTimeout), int(30*time.Second)))

@renaudhartert-db renaudhartert-db Oct 6, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd like the ApiClient to "own" its default values — see tests were the client is hard coding a value that is fundamentally controlled by the caller. Could we do the opposite by (i) removing the upstream default, and (ii) setting the value to 60 seconds here?

@shreyas-goenka shreyas-goenka Oct 6, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The API client already has the timeout set. This PR removes a duplicate line of code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh I see, I misunderstood the change as being about deferring the default logic to the Databricks config. All good 👍

Comment thread httpclient/api_client.go

func NewApiClient(cfg ClientConfig) *ApiClient {
// Set defaults for config values that are not set.
cfg.HTTPTimeout = time.Duration(orDefault(int(cfg.HTTPTimeout), int(30*time.Second)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh I see, I misunderstood the change as being about deferring the default logic to the Databricks config. All good 👍

@shreyas-goenka shreyas-goenka added this pull request to the merge queue Oct 6, 2025
Merged via the queue into main with commit 35d7566 Oct 6, 2025
15 checks passed
@shreyas-goenka shreyas-goenka deleted the fix/timeout branch October 6, 2025 10:43
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.

2 participants