-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lost mutex for key ... #9
Comments
aha, while debugging in VSCode, any breakpoint being hit or pausing of the node service code causes it. |
Hi! "Lost mutex/semaphore ..." thrown in service1 when service2 "steals" the lock (as your service1 thinks). This can happen when service1 doesn't update the lock. Normally it happens every |
Thanks. That explains it, and I have put in mitigation. I am doing some test code now, and I am trying to work out how to set up my test code to catch the
How do I need to set it up so that I can detect and handle this error? |
Unfortunately, you can't catch this error this way because it was designed to be fatal (it's throwns in |
In my nodejs service code I have set up the |
Yep, exactly! The idea (borrowed from book about redis) is to try to acquire lock (or throw error after |
Yeah, great book, only know about it because it was linked from your readme- thanks :-). Sadly, I it seems will not be able to write a jest test due to a "bug" in jest where |
You welcome! |
I am getting 'Lost mutex for key xxx' when using 2 seperate Mutexes on 2 seperate services as part of my moleculer-based app. Just wondering what sort of thing I should be looking for that might cause this? I can't think right now how to construct a minimal example that replicates this behaviour, sorry, Just a few clues would be cool, especially since they are coming up as
UnhandledPromiseRejectionWarning
directly fromRedisMutex._refresh
with no stack trace.The text was updated successfully, but these errors were encountered: