gorouter icon indicating copy to clipboard operation
gorouter copied to clipboard

Don't return empty pool if fallback exists

Open domdom82 opened this issue 3 years ago • 2 comments

  • 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)
  1. cf push any app. Make sure it responds 200 OK on /foo
  2. cf map-route my-app.cf-app.com --hostname my-app --path foo
  3. cf unmap-route my-app.cf-app.com --hostname my-app --path foo
  4. 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 main branch

  • [x] I have run all the unit tests using scripts/run-unit-tests-in-docker from 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

domdom82 avatar Jul 09 '22 12:07 domdom82

FYI the CI job for this was failing irrespective of the PR, and it has been since disabled. Ignore that status check when reviewing.

geofffranks avatar Sep 02 '22 15:09 geofffranks

@jrussett any updates on this PR?

@geofffranks is there a way to re-trigger the CI?

domdom82 avatar Sep 05 '22 14:09 domdom82

@jrussett bump. do you need help reviewing this?

domdom82 avatar May 25 '23 14:05 domdom82