Skip to content

DefaultRedisCacheWriter is not atomic [DATAREDIS-1117] #1686

Closed
@spring-projects-issues

Description

@spring-projects-issues

joongsoo opened DATAREDIS-1117 and commented

If using RedisCacheWriter.lockingCacheWriter(), it is not atomic.

 

In DefaultRedisCacheWriter

  1. execute method wait for unlock. and execute target callable.
  2. try acquire lock in target callable.

 

When the lock is released, many waiting threads possible access to callable.

But doLock method is not guarantee to acquire lock. because it does not check acquired lock.

So multiple threads can run the task at the same time.

 

So the doLock method must be improved to acquired a lock


Affects: 2.2.5 (Moore SR5)

Reference URL: https://github.com/spring-projects/spring-data-redis/blob/master/src/main/java/org/springframework/data/redis/cache/DefaultRedisCacheWriter.java

Referenced from: pull request #518

Metadata

Metadata

Assignees

Labels

in: cacheRedisCache and CacheManagertype: bugA general bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions