-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Confusion about timeout #1529
Comments
I have checked the source code and tried to modify readTimeout, writeTimeout and other max* parameters, but none of them work. No matter how other parameters are set, DoTimeout() will follow the time of the client’s dial. |
I used the official sample code https://github.com/valyala/fasthttp/blob/master/examples/client/client.go and still have the same problem. Also, GetTimeout has a similar problem. [When the timeout parameter set is less than 3 seconds, it can normally return a timeout, but when it is greater than 3 seconds, it still fails to work |
I'm not sure I fully understand, can you post some sample code how you are using fasthttp? |
I use it like this, but when the access is slow, it will return after 3 seconds, not 15 seconds, unless I set the dial |
I'm afraid that currently setting the The timeout is not propagated to the right place: Lines 1912 to 1920 in d0f2727
A pull request to fix this would be welcome. |
I want to use fasthttp.client.DoTimeout() to implement timeout control. It should return immediately after the given timeout and proceed to the next step. After searching various sources, I only found that I can modify the client’s dial to achieve this, but this is not elegant and loses the meaning of using DoTimeout(). My requirement is to easily set different timeouts for each request. After checking the history versions, I found that this problem might have occurred after #1346 . As a last resort, I had to downgrade my fasthttp to version 1.38.0 in my project to meet my needs. Am I using it wrong?
The text was updated successfully, but these errors were encountered: