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
Regression in SimpleThreadScope introduced in 5.2.7 #25618
Comments
This may potentially be a regression introduced in 50a4fda#diff-0a063fe61d0e0640b8c05f6ad641c486. Note that we do have some simple tests in place for this (see SimpleThreadScopeTests and simpleThreadScopeTests.xml). @FernandoFranzini, can you provide a minimal sample application that reproduces the issue you are experiencing? |
@FernandoFranzini, can you confirm the Java version you are using? I ask, because we assume the |
Hi Sam |
Thanks for the prompt feedback. That confirms our suspicions. |
This has been fixed in |
@sbrannen Is this a bug of Java 11+? |
Never mind, I found the answer in commit log. |
Issues gh-25038 and gh-25618 collectively introduced a regression for thread-scoped and transaction-scoped beans. For example, given a thread-scoped bean X that depends on another thread-scoped bean Y, if the names of the beans (when used as map keys) end up in the same bucket within a ConcurrentHashMap AND an attempt is made to retrieve bean X from the ApplicationContext prior to retrieving bean Y, then the use of Map::computeIfAbsent in SimpleThreadScope results in recursive access to the same internal bucket in the map. On Java 8, that scenario simply hangs. On Java 9 and higher, ConcurrentHashMap throws an IllegalStateException pointing out that a "Recursive update" was attempted. In light of these findings, we are reverting the changes made to SimpleThreadScope and SimpleTransactionScope in commits 50a4fda and 148dc95. Closes gh-25801
Hello people
I updated today to spring 5.2.8.RELEASE and started to give error in my mock session for JUNIT
My tdd uses the following configuration:
in version 5.2.6.RELEASE backwards works without error.
Could someone help me how to get around this?
Regards
The text was updated successfully, but these errors were encountered: