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
Hi,
can you please explain what "compromised locks" are?
Also, in the README, the lock signature shows that there are two callbacks, compromised and callback but I don't see any example of usage of compromised. Instead, from what I undestand, a single callback is always used (err, release).
Indeed it should be explained better! Basically, compromised is a function that is called whenever the lock is no longer safe (default implementation simply throws an error, causing the process to exit).
These are edge cases but they might happen if there are huge delays updating the lockfile (e.g. slow nfs disk). If the time took to update the lockfile is greater than the staleness duration, the lock might have been acquired by another process, hence compromised.
I would like to have that explained better in the README. Would you want to do a PR with a better explanation? Thanks
Activity
satazor commentedon Feb 21, 2016
Hi.
Indeed it should be explained better! Basically,
compromisedis a function that is called whenever the lock is no longer safe (default implementation simply throws an error, causing the process to exit).These are edge cases but they might happen if there are huge delays updating the lockfile (e.g. slow nfs disk). If the time took to update the lockfile is greater than the staleness duration, the lock might have been acquired by another process, hence compromised.
I would like to have that explained better in the README. Would you want to do a PR with a better explanation? Thanks
satazor commentedon Mar 29, 2016
Closing due to inactivity.