You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the 'aborted' signal is given, am I right to assume there's some certainty about the lock no longer being valid?
Currently Redlock.using will spend time trying to release the lock, eventually failing with "The operation was unable to achieve a quorum during its retry window", e.g.
functionblockEventLoop(ms){for(conststart=Date.now();Date.now()-start<ms;){}}asyncfunctionsleep(ms){returnnewPromise((resolve)=>setTimeout(resolve,ms));}asyncfunctiontest(){console.time("lock");try{constlock=awaitredlock.using([id],200,{automaticExtensionThreshold: 100,},async(abortSignal)=>{blockEventLoop(200);// prevent auto-extendawaitsleep(200);// allow auto-extend to be attemptedif(abortSignal.aborted){console.log('aborted');throwabortSignal.error;}},);}except(err){console.log(err);}finally{console.timeEnd("lock");// will print between 2000ms and 3000ms (per jitter)}}voidtest();
will print
aborted
The operation was unable to achieve a quorum during its retry window
lock: 2500 ms
The text was updated successfully, but these errors were encountered:
When the 'aborted' signal is given, am I right to assume there's some certainty about the lock no longer being valid?
Currently
Redlock.using
will spend time trying to release the lock, eventually failing with "The operation was unable to achieve a quorum during its retry window", e.g.will print
The text was updated successfully, but these errors were encountered: