Comments (1)
@vany0114 I also share your concern— throwing a ResourceLockederror
when a vote goes against for a given instance and then handling such errors as this more generic ExecutionError
is less than ideal.
I was playing around w/ adding this to the _execute
event loop
while (true) {
const { vote, stats } = await this._attemptOperation(script, keys, args);
attempts.push(stats);
// The operation achieved a quorum in favor.
if (vote === "for") {
return { attempts };
}
if (vote === 'against') {
throw new ResourceLockedError("Quorum Achieved. This instance lost vote")
}
re-throwing as ResourceLockedError
(which is also an exported class of this module) would then allow the consumer of this package to ignore these types of expected errors and only throw for other, unhandled errors.
@mike-marcacci is this something I should create a PR for? i do notice a large backlog of unreviewed PRs and am wondering if this would be a welcome addition
from node-redlock.
Related Issues (20)
- Is there any document about errors that redlock emits?
- Redlock FIFO HOT 2
- Stable release when? HOT 1
- Superfluous type check
- String script parameter(s) ignored HOT 1
- Question about documentation in example snippet HOT 1
- High Availability Failure
- ETA for next v5 release? HOT 2
- Submitting a value for the lock
- Migration guide from 4.2.0 to 5.x?
- Redlock 4.x Compatible with Redit 7.x? HOT 1
- Unable to achieve a quorum during its retry window
- Cannot extend an already-expired lock crashes consumer pods. HOT 1
- "ioredis": "^5.3.2" incompatible with "redlock": "^5.0.0-beta.2" and "@types/redlock": "^4.0.5", HOT 2
- TypeError: client.evalsha is not a function HOT 3
- No support for redis functions
- Lock in use should throw a specific error HOT 1
- Do not wait for lock (NOWAIT)
- Release with fixed type resolution HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-redlock.