You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/02/20 18:45:16 UTC
[GitHub] rob05c commented on issue #3356: Grove: Parent request timeout is
not working
rob05c commented on issue #3356: Grove: Parent request timeout is not working
URL: https://github.com/apache/trafficcontrol/issues/3356#issuecomment-465704566
`parent_request_timeout_ms` should be renamed, it's the connection establish timeout, not the request timeout, the name is misleading, sorry.
> * timeout_ms on remap and rules: no effect
That's the right timeout. It looks like it's not getting set.
So, `retryinggetter.GetAndCache` takes the `timeout` parameter that comes from the rules. We need to fix it to pass that timeout to `web.Request`.
So, change this to pass `timeout`:
https://github.com/apache/trafficcontrol/blob/6e9ff6380f8cfec2c69312ad3344364a24b7c998/grove/cache/retryinggetter.go#L139
Change `web.Request` to `func Request(transport *http.Transport, r *http.Request, timeout time.Duration)`
https://github.com/apache/trafficcontrol/blob/6e9ff6380f8cfec2c69312ad3344364a24b7c998/grove/web/util.go#L111
And, I think there was a reason `web.Request` used `transport.RoundTrip`, instead of making an `http.Client`, but I can't remember what it was now. So, it might just work to change
https://github.com/apache/trafficcontrol/blob/6e9ff6380f8cfec2c69312ad3344364a24b7c998/grove/web/util.go#L116
to:
```
httpClient := &http.Client{Transport: transport, Timeout: timeout}
resp, err ≔ httpClient.Do(rr)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services