Skip to content
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

Fix client default read timeout setting #415

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

kobrineli
Copy link
Contributor

Summary

In this PR I removed setting zero timeout in case of passed negative value.
The problem occurs when we call client.Dial:

  1. Firstly here we call dial and sets default options, and when the ReadTimeout value is NoTimeout, we set it to zero.
  2. Then, in client.Connect method, we call opt.setDefault as well here, but by this moment readTimeout had been already set to default value zero, and here it would be interpreted as time duration zero value and be set to DefaultReadTimeout.

To prevent this error it is sufficient just to remove setting ReadTimeout to zero and leave it with negative value, because here is the only place it is used and current check is enough.

@CLAassistant
Copy link

CLAassistant commented Aug 12, 2024

CLA assistant check
All committers have signed the CLA.

@ernado ernado merged commit 64c5859 into ClickHouse:main Aug 16, 2024
22 of 23 checks passed
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