response timeout configuration through refresh via config-server
#2,138 opened on Feb 3, 2021
Repository metrics
- Stars
- (4,284 stars)
- PR merge metrics
- (Avg merge 1d 21h) (18 merged PRs in 30d)
Description
I want to disable the response-timeout entirely in gateway, which is possible by configuring spring.cloud.gateway.responseTimeout with NULL.
spring:
cloud:
gateway:
httpclient:
connectTimeout: 1000
# defaults to NULL or explicit with responseTimeout: ~
I tested the YAML values 0, -1 and ~ (NULL) as responseTimeout and also removing the whole field to disable the timeout and then started the gateway:
0and-1led to all proxy requests timeout immediatly~and removing the field actually disables the responseTimeout
Now this is fine, it should maybe be mentioned in the documentation, maybe it's obvious ¯\_(ツ)_/¯
BUT
If you use configuration via spring cloud config and the /actuator/refresh endpoint to apply a new config it is impossible to disbale the responseTimeout.
Even worse, if you change the config in the config-server remote source to ~ or if you remove the field, the readTimeout silently stays at the previously configured value:
initial config on boot:
spring:
cloud:
gateway:
httpclient:
connectTimeout: 1000
responseTimeout: 11000
=> downstream requests time out after 11 seconds
decrease responseTimout:
spring:
cloud:
gateway:
httpclient:
connectTimeout: 1000
responseTimeout: 5000
curl -XPOST http://localhost:8943/actuator/refresh
# ["spring.cloud.gateway.httpclient.responseTimeout"]
=> downstream requests time out after 5 seconds
disable responseTimout:
spring:
cloud:
gateway:
httpclient:
connectTimeout: 1000
responseTimeout: ~
or
spring:
cloud:
gateway:
httpclient:
connectTimeout: 1000
curl -XPOST http://localhost:8943/actuator/refresh
# ["spring.cloud.gateway.httpclient.responseTimeout"]
=> downstream requests time out after 5 seconds
So it looks like there is a different behaviour of the global gateway config when you reboot the revice or refresh it via config-client.