|
12 | 12 | # than the schema its build reads. Asked directly on docker_gwbridge, past Traefik, which |
13 | 13 | # still sends the host to the other one. |
14 | 14 | # 2. Its router gets a priority above every other router for the host. That is a label of the |
15 | | -# service, not of its tasks: nothing restarts. Traefik reads it the next time it looks at |
16 | | -# the swarm (every 15 s). |
| 15 | +# service, not of its tasks: nothing restarts (with docker 29.8.0 or newer; raise_priority |
| 16 | +# says why). Traefik reads it the next time it looks at the swarm (every 15 s). |
17 | 17 | # 3. Requests to https://<host>/livez until Traefik's access log names this instance's router |
18 | 18 | # three times in a row (up to SWITCH_TIMEOUT seconds). |
19 | 19 | # The other instance keeps running as it is: it is the rollback, and while this one has no healthy |
@@ -115,13 +115,21 @@ raise_priority() { |
115 | 115 | return 0 |
116 | 116 | fi |
117 | 117 | before="$(running_tasks "${SERVICE}")" |
118 | | - # --detach: a label of the service changes no task, so there is nothing to wait for. |
| 118 | + # --detach: a label of the service changes no task, so there is nothing to wait for, as long as |
| 119 | + # the CLI changes nothing else: "service update" hands swarm the whole spec back. Before docker |
| 120 | + # 29.8.0 it sorted the mounts on every call (docker/cli#7227), which moved Folia's tmpfs to the |
| 121 | + # front: a new task template for swarm, so the web server restarted, and Traefik sent the host |
| 122 | + # back to the other colour until it was healthy (a test swarm with 29.3.1). The switches on the |
| 123 | + # server (29.8.1) changed the label and nothing else (checked 2026-09-30). What an update |
| 124 | + # changed: .PreviousSpec against .Spec from the Engine API (curl -s --unix-socket |
| 125 | + # /var/run/docker.sock http://localhost/services/<name>), not from "docker service inspect", |
| 126 | + # which fills swarm's defaults into .Spec only (an empty DNSConfig, the rollback's Monitor). |
119 | 127 | docker service update --detach=true --label-add "${PRIORITY_LABEL}=$((best + 1))" "${SERVICE}" >/dev/null |
120 | 128 | log "${ROUTER}: priority ${own} -> $((best + 1)) (${others[*]}: ${best})" |
121 | 129 | sleep 3 |
122 | 130 | after="$(running_tasks "${SERVICE}")" |
123 | 131 | if [[ "${before}" != "${after}" ]]; then |
124 | | - warn "the tasks of ${SERVICE} changed with the label (${before}-> ${after}); swarm is not meant to restart them for it" |
| 132 | + warn "the tasks of ${SERVICE} changed with the label (${before}-> ${after}): docker $(docker version --format '{{.Client.Version}}' 2>/dev/null || true) sent swarm more than the label (before 29.8.0 the CLI sorts the mounts), and swarm restarts the web server for it. Until the new task is healthy, Traefik sends https://${INSTANCE_HOST} to ${others[*]}; the next step waits for that" |
125 | 133 | fi |
126 | 134 | } |
127 | 135 |
|
|
0 commit comments