From 72d9257d54bff95d02f1bc0d65e6942269497e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20H=C3=B6rberg?= Date: Wed, 11 Dec 2024 10:02:34 +0100 Subject: [PATCH] Document that polling the data_dir_lock is only required on NFS/SMB --- src/lavinmq/data_dir_lock.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lavinmq/data_dir_lock.cr b/src/lavinmq/data_dir_lock.cr index 5ece0384f3..87d752a4f6 100644 --- a/src/lavinmq/data_dir_lock.cr +++ b/src/lavinmq/data_dir_lock.cr @@ -11,6 +11,7 @@ module LavinMQ @lock.read_buffering = false end + # See `man 2 flock` def acquire begin @lock.flock_exclusive(blocking: false) @@ -31,7 +32,7 @@ module LavinMQ @lock.flock_unlock end - # Read from the lock file to detect lost lock + # Read from the lock file to detect lost lock on networked filesystems (NFS/SMB) # See "Lost locks" in `man 2 fcntl` def poll @lock.read_at(0, 1, &.read_byte) || raise IO::EOFError.new