-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
Here is my core code
client := &fasthttp.Client{
Name: "timeout-test-client",
}
req := fasthttp.AcquireRequest()
resp := fasthttp.AcquireResponse()
defer func() {
fasthttp.ReleaseRequest(req)
fasthttp.ReleaseResponse(resp)
}()
req.SetRequestURI("http://aaaa.com")
req.Header.SetMethod(fasthttp.MethodPost)
req.Header.SetContentType("application/json")
req.SetBodyRaw(body)
fmt.Println("###########start", start)
if err = client.DoTimeout(req, resp, time.Second*5); err != nil {
fmt.Println("###########end", time.Now().Sub(start))
return false, err
}
fmt.Println("###########end", time.Now().Sub(start))
And i got this:
###########start 2025-09-19 05:23:21.961335825 +0000 UTC m=+0.000482228
###########end 32.247683172s
Why do I still get a timeout result after 30 seconds even if I set a 5-second timeout?
Did I miss any setting? Thanks you all
Metadata
Metadata
Assignees
Labels
No labels