Skip to content

GH-3243: sync computeIfAbsent in StoredProcExec #3244

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

Merged
merged 1 commit into from
Apr 7, 2020

Conversation

artembilan
Copy link
Member

Fixes #3243

It turns out that ConcurrentModificationException is thrown from the
HashMap.computeIfAbsent(HashMap.java:1134) since Java 9 when the map is
modified concurrently independently from the key we try to modify

  • Check for the value presence before computing
  • synchronized(this.jdbcCallOperationsMap) around computeIfAbsent()
    when get() == null

Cherry-pick to 5.2.x

Fixes spring-projects#3243

It turns out that `ConcurrentModificationException` is thrown from the
`HashMap.computeIfAbsent(HashMap.java:1134)` since Java 9 when the map is
modified concurrently independently from the key we try to modify

* Check for the value presence before computing
* `synchronized(this.jdbcCallOperationsMap)` around `computeIfAbsent()`
when `get() == null`

**Cherry-pick to 5.2.x**
@garyrussell garyrussell merged commit 2d7e473 into spring-projects:master Apr 7, 2020
@garyrussell
Copy link
Contributor

And cherry-picked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConcurrentModificationException in StoredProcExecutor
2 participants