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

Set Timeout for Read/Write Locks in RefreshScope

Open
#1,401 0 comments 0 reactions 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.
The current refreshScope process controls refresh operations using read/write locks, but there is no timeout set. If the lifecycle function of a bean takes a very long time to execute, it can lead to prolonged blocking during the refresh process or when obtaining the bean, without any related log messages.

Describe the solution you'd like
Is it possible to set a timeout for the lock? If so, could I try submitting a PR for this?

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 by locating RefreshScope and its read/write lock usage, then inspect how long-running bean lifecycle work can block refresh and bean acquisition. Define the timeout and logging behavior, add coverage for blocked operations, and verify that refresh and bean access report the timeout as expected.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.