1

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 = "the-thing-we-are-locking-on";
var expiry = TimeSpan.FromSeconds(30);
using (var redisLock = lf.Create(resource, expiry))
{
    Response.Write("Lock acquired: " + redisLock.IsAcquired);
}

I'm struggling to work out why, as I'm able to cache things in Redis just fine with StackExchange.Redis connection string localhost,allowAdmin=true.

In the Redis console I can see a client is being connected, but that's as far as it gets.

I've added a firewall rule for port 6379 but nothing changed.

Any ideas on my the lock can never be acquired?

Tom Gullen
  • 61,249
  • 84
  • 283
  • 456

1 Answers1

0

Found the cause of the issue. I'm using MSOpenTech Redis server v3.2.100: https://github.com/MSOpenTech/redis/releases

Rolling back to v3.0.500 appears to fix the issue. Not ideal, but in testing environment should be OK for now.

Tom Gullen
  • 61,249
  • 84
  • 283
  • 456