Skip to content

vere: use fcntl advisory locks on pidfile#697

Merged
pkova merged 1 commit into
developfrom
jb/lockfile
Aug 6, 2024
Merged

vere: use fcntl advisory locks on pidfile#697
pkova merged 1 commit into
developfrom
jb/lockfile

Conversation

@joemfb

@joemfb joemfb commented Aug 6, 2024

Copy link
Copy Markdown
Collaborator

The PR replaces vere's current (buggy, insufficient) lockfile mechanism with an advisory fcntl() write lock (F_SETLK, F_WRLCK) on the first byte of vere's PID file ($pier/.vere.lock). It does not (yet?) include the functionality to kill the lock-holder and take over the pier, as I'm not sure that's desirable.

There have been many problems with vere's current lockfile implementation. The biggest advantage of this approach is that the lock is automatically released if the process is killed or the host system crashes. The biggest question is: does it work reliably across docker shared volumes, virtual machines, &c.

@joemfb joemfb changed the title vere: use fctl advisory locks on pidfile vere: use fcntl advisory locks on pidfile Aug 6, 2024
@pkova pkova marked this pull request as ready for review August 6, 2024 17:36
@pkova pkova requested a review from a team as a code owner August 6, 2024 17:36
@pkova pkova merged commit 47d2fed into develop Aug 6, 2024
@pkova pkova deleted the jb/lockfile branch August 6, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants