How to delete advisory file locks from a volume on-time?

I want to use advisory file locks (flock(), with some Node.js wrapper) in a volume.

When starting, the system, the directory with locks should be cleared, to ensure no stale locks from possible past crashes.

But if there is more than one machine, how to define “when starting”? One machine would mistakenly delete locks by another one, when starting.

A volume can only ever be mounted on one machine (they’re just slices of local NVMe disks), so it is impossible for another machine to see an active lock created by another machine. You can clone volumes but the cloned one will be completely independent from the original.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.