-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cache in RedisUtils is not thread safe #2884
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
Why do we call this on every remove call anyway? We should just cache the result in the store and registry during intiialization since the |
garyrussell
added a commit
to garyrussell/spring-integration
that referenced
this issue
Apr 5, 2019
Fixes spring-projects#2884 - synchronize the map - only call once per component
garyrussell
added a commit
to garyrussell/spring-integration
that referenced
this issue
Apr 5, 2019
Fixes spring-projects#2884 - synchronize the map - only call once per component
artembilan
pushed a commit
that referenced
this issue
Apr 5, 2019
Fixes #2884 - synchronize the map - only call once per component
artembilan
pushed a commit
that referenced
this issue
Apr 5, 2019
Fixes #2884 - synchronize the map - only call once per component # Conflicts: # spring-integration-redis/src/test/java/org/springframework/integration/redis/util/RedisLockRegistryTests.java
Thanks for the quick fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Affects Version(s): master
The
LinkedHashMap
in https://github.com/spring-projects/spring-integration/blob/master/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisUtils.java is accessed from multiple threads when usingRedisLockRegistry
, resulting in concurrency exceptions. I worked around the problem in my app by overriding the implementation there with one using Guava's cache. Spring integration doesn't have a dependency on Caffeine or Guava, or I'd have submitted a simple patch.The text was updated successfully, but these errors were encountered: