Questions tagged [redlock.net]

An implementation of the Redlock distributed lock algorithm

The Redlock algorithm is designed to be used with multiple independent Redis instances.

To install RedLock.net, run the following command in the Package Manager Console.

Install-Package RedLock.net 
11 questions
6
votes
1 answer

Redlock with redis-ha cluster

I have been trying to configure a distributed RedLock against a redis cluster installed in kubernetes from the helm chart stable/redis-ha. Ideally I would want the cluster to have multiple replicas (primary/secondary replication). I am following the…
TGH
  • 38,769
  • 12
  • 102
  • 135
3
votes
2 answers

Bursts of Redis errors

We've recently created a new Standard 1 GB Azure Redis cache specifically for distributed locking - separated from our main Redis cache. This was done to improve stability on our main Redis cache which is a very long term issue which this action…
Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
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

Mocking Redlock.CreateAsync does not return mocked object

I am trying to Mock Redlock I have the test below using Moq; using RedLockNet; using System; using System.Threading; using System.Threading.Tasks; using Xunit; namespace RedLock.Tests { public class RedLockTests { [Fact] …
Paul
  • 2,773
  • 7
  • 41
  • 96
1
vote
1 answer

Should Redis locks be run on a seaprate instance?

We're using: Standard Redis on Azure StackExchange.Redis RedLock.net Our website has grown significantly over the last year or two, now serving ~250,000,000 uncached requests per month according to Cloudflare. Sporadically, we see a couple of…
Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
1
vote
1 answer

What's the better redis locking mechanism to use to avoid async validation fails in rails?

I encountered a problem wherein asynchronous saving in one of our models with uniqueness validation declared in Application level is not blocked by the said validation. Adding the validation in the Database level is not an option for me due to a…
Kok A.
  • 167
  • 1
  • 15
1
vote
1 answer

Unlock Redis Locks From CLI

I have a java app that has multiple instances over a local network. It uses Redis Redlock to manage integrity of a shared database. Issue here is this java app is still highly unstable so that it crash lot of times. When one instance crashed and it…
Gayan Viranka
  • 443
  • 1
  • 6
  • 17
1
vote
1 answer

Redlock.net can't aquire lock

Using: StackExchange.Redis v1.1.608.0 RedLock.net v1.7.4.0 This code always returns false after 250-600ms: var eps = new [] { new DnsEndPoint("localhost", 6379) }; var lf = new RedisLockFactory(eps); var resource =…
Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
0
votes
1 answer

Super basic questions about using RedLockFactory.CreateLockAsync()

The following pseudocode may be a little too boiled down, but this is more of a general question using (var thelock = await redLockFactory.CreateLockAsync()) { await doWorkWhileLockIsOn(); } How do I know the work done inside the async…
ASP.Tom
  • 11
  • 4
0
votes
1 answer

Distributed lock is not working with RedLock.net

I want to use Redis for distributed lock. I'm using RedLock.net nuget package for this. But thread is able to acquire the lock, even another thread is already acquired the lock. Here is sample code: public void Demo(RedLockFactory redLockFactory) …
Programmer
  • 398
  • 1
  • 9
  • 33
0
votes
1 answer

Azure Web Jobs Redis (RedLock) & Blob Storage Access Issues

We switched to WebJobs with our background tasks that are starting to work when a new item lands on an Azure Queue. Now we have some weird issues that he seems to have problems accessing Redis RedLock and Storage that I can't explain. Now the…
Hypi
  • 127
  • 1
  • 8