Skip to content

try 2: use flock automatic lock for upgrade - #1917

Closed
meonkeys wants to merge 5 commits into
nextcloud:masterfrom
meonkeys:ephemeral-upgrade-lock
Closed

try 2: use flock automatic lock for upgrade#1917
meonkeys wants to merge 5 commits into
nextcloud:masterfrom
meonkeys:ephemeral-upgrade-lock

Conversation

@meonkeys

@meonkeysmeonkeys commented Feb 8, 2023

Copy link
Copy Markdown
Contributor

This is #1757, revisited.

Only this or#1905 should be merged (if either are merged). Both PRs intend a change from (a) treating nextcloud-init-sync.lock's existence to indicate an upgrade in progress to (b) using the flock shell command (either GNU's or Busybox's). Switching to (b) provides an atomic and ephemeral (automatically cleaned-up) lock.

@meonkeys
meonkeysforce-pushed the ephemeral-upgrade-lock branch 2 times, most recently from d4b4222 to 9b4a2c6CompareFebruary 8, 2023 18:22
fixnextcloud#1756fixnextcloud#1903
Signed-off-by: Adam Monsen <haircut@gmail.com>
/var/lock is not likely shared across Nextcloud app server containers
Borrowed this idea from @remram44's patch in nextcloud#1905.
Signed-off-by: Adam Monsen <haircut@gmail.com>
Note there are no changes to `Dockerfile-alpine.template`. We thought we needed `util-linux` for `flock`, but we don't. Busybox includes `flock`, and this command is compatible with GNU `flock` for our use case (I tested it with `flock -n 9`, etc).
Signed-off-by: Adam Monsen <haircut@gmail.com>
@meonkeys
meonkeysforce-pushed the ephemeral-upgrade-lock branch from 9b4a2c6 to 63f1baaCompareFebruary 8, 2023 18:29
@meonkeys

meonkeys commented Feb 8, 2023

Copy link
Copy Markdown
ContributorAuthor

Sorry for all the force-pushes. I don't intend to do that again.

@meonkeys

meonkeys commented Feb 8, 2023

Copy link
Copy Markdown
ContributorAuthor

We might want to rename nextcloud-init-sync.lock so folks aren't confused by old comments suggesting they manually delete that file to fix a stalled upgrade.

Eh, I'm kind of split on this... the file can be used as-is.

Note that nextcloud-init-sync.lock appears in upgrade.exclude, so the file may appear and disappear for some people. Probably no big deal.

Avoids update.sh unnecessarily updating **/entrypoint.sh
Signed-off-by: Adam Monsen <haircut@gmail.com>
@meonkeys
meonkeysforce-pushed the ephemeral-upgrade-lock branch from bc6c48c to bf03632CompareFebruary 8, 2023 18:41
@meonkeys

Copy link
Copy Markdown
ContributorAuthor

Argh! I lied, one more force push (forgot to use --signoff)

@meonkeys

Copy link
Copy Markdown
ContributorAuthor

Let's use #1905 instead.

@meonkeysmeonkeys closed this Feb 8, 2023
Sign up for freeto 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.

1 participant

@meonkeys