-
Notifications
You must be signed in to change notification settings - Fork 225
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
Is there a way to set "EndpointTimeoutInSeconds" for an APP separately? #100
Comments
We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/106275206. |
Hello @Liuyanglong, as you observed it is not currently possible to configure the request timeout per app. It's worth considering that in order to keep the routing tier generic, Gorouter doesn't know anything about apps in Cloud Foundry. It only knows about routes - the mapping of a url to a backend ip and port. Could you please explain why setting the global property We could consider enhancing Gorouter to support clients registering these routes (via NATS now, via Routing API in the future) to provide a timeout for each route, but exposing this to Cloud Foundry end users would require significant updates: CLI, Cloud Controller, CC-bridge, Route Emitter, and Gorouter. I recommend:
I've made a note of your request and will listen for the same request from others in the future. Thank you! |
I have two apps,“a.com” and "b.com", a.com is normal http request, the endpoint will return in few seconds.but b.com is upload big file request, the endpoint will take more than 100s to finish processing a request. Now I want only set EndpointTimeoutInSeconds=300s to b.com. And when I set EndpointTimeoutInSeconds=300s, after several hours , I receive a error "502 Bad Gateway: Registered endpoint failed to handle the request." when I request a.com and b.com. Is this a bug? Or how should I solve this error. Thank you. |
Changes to The default for Could you provide more information about the environment in which you observed the 502? This response is returned when the backend failed to respond. However, this error should be returned immediately after the timeout, not hours later. Possibilities:
Could you provide us with steps to reliably reproduce the issue? |
I only use gorouter as my router tool. Behind gorouter is docker container and manual update the rules。If I do not any operation to "EndpointTimeoutInSeconds", after 60s, the connection will be closed by Gorouter. About the 502 error, the information I get is only these "502 Bad Gateway: Registered endpoint failed to handle the request" when I request the app and there is no any log in app containers, but after I restart Gorouter , the requests went OK. so I am sure its Gorouter report the 502error. Thank you |
This is expected behavior, as 60s is the default value.
Gorouter returns this error when a backend (your docker container) fails to respond within the timeout. The timeout can be manually configured using For more information, you can enable debug level logging for gorouter in the config.yml. A restart is required.
When gorouter starts the first time, are requests routed to your app successfully? Are you saying that after some period of time of healthy operation, requests to the app begin returning this 502 error? And then restarting gorouter results in requests being routed successfully? Is the ip or port of your docker container changing, and gorouter isn't being updated? |
Hi @Liuyanglong As per @shalako above, can you clarify the last few questions?
How are routes being registered with gorouter ? Can you check the gorouter routing table and seeing if the route is expiring (and being removed)? For example, when running gorouter locally using bosh-lite, you can hit the status endpoint to dump the routes. Thanks |
Hello @Liuyanglong |
In the gorouter config, there is a param "EndpointTimeoutInSeconds", the default is 60s, it means when a request over 60 secends the connection will close.
Is there a way to set this parameter for an APP separately?
I have 2 app, "a.com" & "b.com" , I want to set EndpointTimeoutInSeconds=120s for app "a.com" and set "EndpointTimeoutInSeconds=60s" for app "b.com". But “EndpointTimeoutInSeconds” is global for all apps.
I need some help. Thank you
The text was updated successfully, but these errors were encountered: