-
Notifications
You must be signed in to change notification settings - Fork 38.5k
ConcurrentHashMap.computeIfAbsent used in AdvisedSupport can cause virtual thread pinning #32958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The message you've shared mentions:
Isn't this going to be a huge performance drawback for everyone here? Also, another message in the thread points to the fact that the Javadoc explicitly says that "Some attempted update operations on this map by other threads may be blocked while computation is in progress, so the computation should be short and simple." Doesn't this mean that the pinning is very short because computation should be very short? In my opinion, we should wait for the JDK team and not work on a sub-optimal solution in this case. |
That really depends on the use case of I don't see usage of If this possible, then it will allow Spring to be fully VT compatible now and not somewhere in the future. |
In some locations, we perform independent get/put steps against a |
@jhoeller I guess so - it looks like |
Alright, I'll revise this as a concurrency performance regression for 6.1.9 then. It is effectively a regression since 6.0.x and 5.3.x do not show that effect, and it's also an inconsistency with the shared cache code path in |
When running Spring Boot application with
-Djdk.tracePinnedThreads=full
, this log message appears in the logs:synchronized
usage inConcurrentHashMap
seems to be a known problem, but still not solved.Would it be possible to avoid usage of
ConcurrentHashMap
inorg.springframework.aop.framework.AdvisedSupport.java:503
and use something likeHashMap
andReadWriteLock
instead?The text was updated successfully, but these errors were encountered: