spring-cloud / spring-cloud/spring-cloud-commons

Why does RefreshScope refresh all beans instead of only refreshing the beans that are dependent on the configuration item? org.springframework.cloud.context.refresh.ContextRefresher#refresh

Open
#1,262 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
751
Forks
744
Avg merge
1d 14h
Merged PRs (30d)
9

Description

Is your feature request related to a problem? Please describe.
When I update a particular configuration in Nacos in a production environment with high concurrency, some servers will remain unresponsive for a long time.

Describe the solution you'd like
Update only the properties of the Bean corresponding to the configuration item.

Describe alternatives you've considered
Dispose of the currently associated bean, initialize it directly, and replace the original object reference.

Additional context
org.springframework.cloud.context.refresh.ContextRefresher#refresh
image

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

Start with org.springframework.cloud.context.refresh.ContextRefresher#refresh and trace the refresh-scope behavior it invokes. Determine how changed configuration properties are associated with beans and what parts of the current refresh affect unrelated beans. Done means the issue has a concrete, validated design for refreshing only affected beans without the reported high-concurrency unresponsiveness.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.