node-redlock icon indicating copy to clipboard operation
node-redlock copied to clipboard

High Availability Failure

Open ocdkerosine opened this issue 2 years ago • 0 comments

Redlock is instantiated with three independent Redis instances. They run on different containers on different ports. When i shutdown one of the instances and try to acquire a lock it simply throws out EAI_AGAIN errors until i restart the instance and then the lock is successfully acquired or sometimes not.

If it is supposed to failover why does this behaviour exist? Instantiation below

        LockService.lock = new Redlock(
            [LockService.redis, LockService.redis2, LockService.redis3],
            {
                driftFactor: LockService.driftFactor, //all default values from repo
                retryCount: LockService.retryCount,
                retryDelay: LockService.retryDelay,
                retryJitter: LockService.retryJitter,
                automaticExtensionThreshold:
                    LockService.automaticExtensionThreshold,
            }
        );

After Shutting down one instance:

Screenshot 2023-02-04 181404

After restarting instance:

Screenshot_20230204_063426

ocdkerosine avatar Feb 04 '23 17:02 ocdkerosine