spring-cloud / spring-cloud/spring-cloud-gateway

Questions about Route Cache Rebuilding

Open
#1,541 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feedback-provided
Dominant language
Java
Stars
4.9k
Forks
3.5k
Avg merge
20h 57m
Merged PRs (30d)
8

Description

I am using Spring Cloud Gateway (Hoxton.SR1 on SB 2.2.2 and Java 11.0.3). I am running into a problem where under high load some requests fail because the configured route can not be found. In my particular case 'fail' means, that the exchange attribute 'gatewayRoute' is not set, which leads to an error at a later point in my filter chain.

I suspect this is related to rebuilding the route cache. This rebuild happens periodically because I use it together with Spring Cloud Config (correct?). I managed to reproduce this error by rebuilding the route cache manually via actuator.

My questions are:

  1. Is the rebuilding the route cache designed and implemented to be an atomic operation?
  2. Can I disable the cache rebuilding and still distribute my routes via Spring Cloud Config?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing the actuator route-cache rebuild and the route lookup path in Spring Cloud Gateway, then inspect how Spring Cloud Config refreshes routes. Done would mean establishing whether rebuilding is atomic and whether cache rebuilding can be disabled while retaining Config-distributed routes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.