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

await redlock.using will never resolve

Open SinanAkkoyun opened this issue 3 years ago • 7 comments

Hi, I don't know what causes this behaviour, but no matter how I try to use your code, I am never getting it to work

redlock.using([`util:${this.settings.hostIP}`], minimalDelay+1, async signal => {
              const result = await stuff(ctx.params.cred) // takes approx 5s

              if (signal.aborted) {
                throw signal.error
              }
              return result
            })

I always error out:

ExecutionError: The operation was unable to achieve a quorum during its retry window.
 at Redlock._execute (/app/node_modules/redlock/dist/cjs/index.js:296:23)
 at async Redlock.acquire (/app/node_modules/redlock/dist/cjs/index.js:213:34)
attempts: [
 Promise { [Object] },
...,
Promise { [Object] }
 ]

And when I increase the tries before erroring out, it will just never resolve What could I be doing wrong? Thanks

SinanAkkoyun avatar May 12 '22 01:05 SinanAkkoyun

To further add to this, this happens from the beginning on, not even once does "stuff" run.

I am using one redis server, my app and the server in one docker-compose

SinanAkkoyun avatar May 12 '22 02:05 SinanAkkoyun

Just encountered this. We were able to work around this by using the await lock.acquire() api.

thecodedrift avatar May 12 '22 19:05 thecodedrift

hello @mike-marcacci , this issue should be fixed with the PR which got merged. We're waiting for you to release a new npm version for redlock with this fix ASAP as my team has a requirement for using auto extending locks.

arath17 avatar Apr 05 '23 06:04 arath17

Hello, @mike-marcacci , please, release new version with #274

PomanoB avatar Apr 28 '23 22:04 PomanoB

Hi, @mike-marcacci , could you be so kind to release a new version with that fix, please?

RGurevich avatar Apr 30 '23 09:04 RGurevich

hey guys just wanted to chime in here, what is blocking this? I am also having issues with this same thing.

aduca98 avatar May 10 '23 06:05 aduca98

https://github.com/mike-marcacci/node-redlock/pull/274#issuecomment-1610154289

temich avatar Jun 27 '23 20:06 temich