Skip to content

ConcurrentHashMap.computeIfAbsent used in AdvisedSupport can cause virtual thread pinning #32958

Closed
@andrej-urvantsev

Description

When running Spring Boot application with -Djdk.tracePinnedThreads=full, this log message appears in the logs:

VirtualThread[#218,backgroundjob-worker]/runnable@ForkJoinPool-1-worker-11 reason:MONITOR
      java.base/java.lang.VirtualThread$VThreadContinuation.onPinned(Unknown Source)
      java.base/jdk.internal.vm.Continuation.onPinned0(Unknown Source)
      java.base/java.lang.VirtualThread.park(Unknown Source)
...
     java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source) <== monitors:1
     org.springframework.aop.framework.AdvisedSupport.getInterceptorsAndDynamicInterceptionAdvice(AdvisedSupport.java:503)

synchronized usage in ConcurrentHashMap seems to be a known problem, but still not solved.

Would it be possible to avoid usage of ConcurrentHashMap in org.springframework.aop.framework.AdvisedSupport.java:503 and use something like HashMap and ReadWriteLock instead?

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: feedback-providedFeedback has been providedtype: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions