Questions tagged [redlock]
7 questions
2
votes
0 answers
Sidekiq / Ruby On Rails - Lock using Redis (Redlock) not locking correctly
I'm trying to lock a part of my code using Redis, with Redlock library.
I've implemented it here:
def perform(task_id, task_type)
lock_manager = Redlock::Client.new([ "redis://127.0.0.1:6379" ])
lock_key =…

Amit
- 155
- 1
- 1
- 15
1
vote
0 answers
Redis Redlock based distributed lock retry question
Background: currently I am investigating the mechanism of distributed lock in order to implement it in our email service to deduplicate in the time the QPS is high.
The main article I am reading is this one…

Drake
- 165
- 1
- 11
1
vote
1 answer
How to choose the right value for the expiryTime parameter for RedLockFactory.CreateLockAsync() method?
I am using RedLock.net library for resource locking. To lock a resoruce I am using RedLockFactory.CreateLockAsync.
public async Task RedLockFactory.CreateLockAsync(string resource,
TimeSpan expiryTime,
TimeSpan waitTime,
…

RM.
- 1,984
- 19
- 29
1
vote
1 answer
What happens if a resource is already locked?
I'm trying to use RedLock to prevent 2 users from doing an operation on the same resource at once (Booking something too quickly from one another). But I want it to fail completely if the resource is already acquired by someone else (Booking…

ALostBegginer
- 41
- 4
0
votes
1 answer
I can't lock value of the redis with redlock. How to lock the value in the redis?
I'd like to lock value in the redis with redlock.
But, It's not locked even though lock is done successfully.
This is my test code. Pushed data is 'refId:1234' and lock it for 4 seconds.
So, pop should be done after 4 seconds. But, it's poped after…

fbyself2011
- 81
- 2
- 9
0
votes
1 answer
Synchronise redis read and write with multiple threads in my node application
I have a nodejs application running (haraka smtp server) with 1 master thread and 7 worker threads . I'm using redis to read some counters and after some operations I'm updating those counters.
I'm facing the issue of race condition where some of…
0
votes
1 answer
Using Redis transaction vs redlock to solve the Lost Update Problem
I'm working with a Redis cluster having 2+ nodes. I'm trying to figure out which tool best fits for handling concurrency - transaction or locking. Transactions are well documented, but I didn't find a good best-practice-example on redlock. I also…

Dan
- 55,715
- 40
- 116
- 154