mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 03:38:23 +00:00
fix(moodle): survive flock EIO on the NFS bootstrap lock and widen the converge budget
Six replicas race the bootstrap lock across three NFS clients; the truncating open invalidated the holder's lock state, so flock died with EIO and the task crash-looped with exit 65 until the winner finished the ~6min code copy. The lock file is now opened append-only and flock failures fall back to a sentinel recheck loop instead of killing PID 1. The converge budget gets the same 600-retry override the other slow-bootstrap roles already carry; the default 150 missed this run's recovery by six seconds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
e7e32d14d4
commit
7bc5822421
2 files changed
+9
-10
No files matched your search
@@ -33,17 +33,15 @@ moodle_bootstrap_code_dir() {
|
||||
touch "${MOODLE_BOOTSTRAP_SENTINEL}"
|
||||
}
|
||||
|
||||
if [ ! -f "${MOODLE_BOOTSTRAP_SENTINEL}" ]; then
|
||||
mkdir -p "${MOODLE_CODE_DIR}"
|
||||
exec 9>"${MOODLE_BOOTSTRAP_LOCK}"
|
||||
flock 9
|
||||
moodle_bootstrap_code_dir
|
||||
flock -u 9
|
||||
exec 9>&-
|
||||
fi
|
||||
|
||||
mkdir -p "${MOODLE_CODE_DIR}"
|
||||
while [ ! -f "${MOODLE_BOOTSTRAP_SENTINEL}" ]; do
|
||||
sleep 1
|
||||
exec 9>>"${MOODLE_BOOTSTRAP_LOCK}"
|
||||
if flock -w 30 9; then
|
||||
moodle_bootstrap_code_dir
|
||||
else
|
||||
sleep 5
|
||||
fi
|
||||
exec 9>&-
|
||||
done
|
||||
|
||||
if [ "$(id -u)" -eq 0 ] && [ "${1:-}" != "php-fpm" ]; then
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
application_id: "web-app-moodle"
|
||||
entity_name: "{{ application_id | get_entity_name }}"
|
||||
swarm_stack_converge_retries: 600
|
||||
|
||||
MOODLE_CODE_DIR: "/var/www/html"
|
||||
MOODLE_DATA_DIR: "/var/www/moodledata"
|
||||
|
||||
Reference in new issue
Block a user