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

spring-cloud Lock bug, @RefreshScope class

Open
#1,589 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

升级 spring cloud 2023.0.3 之后 运行一段时间出现大量锁等待线程.
After upgrading to Spring Cloud 2023.0.3, a large number of lock waiting threads appeared after running for a period of time.

  "java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.5.0.5/Native Method)
	- parking to wait for  <0x00000005c3727250> (a java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
	at java.util.concurrent.locks.LockSupport.park(java.base@21.0.5.0.5/LockSupport.java:221)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@21.0.5.0.5/AbstractQueuedSynchronizer.java:754)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(java.base@21.0.5.0.5/AbstractQueuedSynchronizer.java:1079)
	at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(java.base@21.0.5.0.5/ReentrantReadWriteLock.java:738)
	at org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke(GenericScope.java:478)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:720)
"

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 the reported stack trace at org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke and inspect the related GenericScope.java implementation in Spring Cloud 2023.0.3. Compare the lock behavior with the prior version and reproduce the waiting threads after applying @RefreshScope. The issue does not define a confirmed fix or test, so completion would require an agreed diagnosis and regression coverage.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.