Don't return empty pool if fallback exists
- A short explanation of the proposed change:
This PR fixes https://github.com/cloudfoundry/routing-release/issues/279
A regression was introduced with https://github.com/cloudfoundry/gorouter/pull/314 that returns 503 on routes with a path. If the path gets unmapped, gorouter returns 503 instead of falling back to the non-path route.
- An explanation of the use cases your change solves
Mapping a more specific path /foo on an app is a valid use case for route services that may be used to rate limit that path only (instead of the whole app).
However, you still want to be able to use the less specific path / if you unmap the /foo route. Instead, gorouter gives you a 503 if empty_pool_response_code_503 and empty_pool_timeout are enabled.
- Instructions to functionally test the behavior change using operator interfaces (BOSH manifest, logs, curl, and metrics)
-
cf pushany app. Make sure it responds 200 OK on/foo -
cf map-route my-app.cf-app.com --hostname my-app --path foo -
cf unmap-route my-app.cf-app.com --hostname my-app --path foo -
curl https://my-app.cf-app.com/foo
- Expected result after the change
200 OK (coming from my-app.cf-app.com)
- Current result before the change
503 Service Unavailable: Requested route ('my-app.cf-app.com') has no available endpoints.
-
Links to any other associated PRs https://github.com/cloudfoundry/gorouter/pull/314
-
[x] I have viewed signed and have submitted the Contributor License Agreement
-
[x] I have made this pull request to the
mainbranch -
[x] I have run all the unit tests using
scripts/run-unit-tests-in-dockerfrom routing-release. -
[ ] (Optional) I have run Routing Acceptance Tests and Routing Smoke Tests on bosh lite
-
[ ] (Optional) I have run CF Acceptance Tests on bosh lite
FYI the CI job for this was failing irrespective of the PR, and it has been since disabled. Ignore that status check when reviewing.
@jrussett any updates on this PR?
@geofffranks is there a way to re-trigger the CI?
@jrussett bump. do you need help reviewing this?