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

HostClient.DoDeadline() error #1617

Closed
YzmjY opened this issue Sep 8, 2023 · 1 comment
Closed

HostClient.DoDeadline() error #1617

YzmjY opened this issue Sep 8, 2023 · 1 comment

Comments

@YzmjY
Copy link

YzmjY commented Sep 8, 2023

Code:

	c := fasthttp.HostClient{
		Addr: "127.0.0.1:8080",
	}

	req := fasthttp.AcquireRequest()
	req.SetHost("127.0.0.1")
	req.Header.SetMethod("GET")
	rsp := fasthttp.AcquireResponse()
	dd := time.Now().Add(time.Second * 4)
	err := c.DoDeadline(req, rsp, dd)
	if err != nil {
		panic(err)
	}

I found that the timeout parameter doesn't work in this case, cause the config item RetryIf of HostClient will retry and ignore the timeout if the request is GET/HEAD/PUT method.I think it is not as expected , casue I set the timeout, then the DoDeadline should return before the deadline or return a timeout error.

@erikdubbelboer
Copy link
Collaborator

Good find, I just pushed a fix.

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

No branches or pull requests

2 participants