You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c84be84
Browse filesBrowse the repository at this point in the historyBrowse files
Stop waiting for services that are not meant to be running
Both open timeout reports come from the same place: the wait loop treats
"fewer replicas running than wanted" as "still converging", which is
wrong for any service that is not supposed to be running.
A `mode: replicated-job` service that has finished reports its replicas
as "0/1 (1/1 completed)". The completion count was cut away before
anything looked at it, leaving current(0) != target(1) forever. Read the
whole field and use the count: a job is settled once every requested run
has completed, and reported as job_running until then.
A service the stack file declares with `replicas: 0` is a different
case, and indistinguishable from the one above by the replicas field
alone -- there is no completion count to disambiguate a finished run
from a service that failed to start. So consult the spec instead of the
observed target. The two disagree exactly when this bites: stack deploy
returns before the new spec is applied, and an external scheduler may
have scaled the service since. The spec is re-read every poll, so a
stale target corrects itself rather than being trusted once.
A service whose spec really does ask for replicas still times out; that
is covered by a test, because the shortcut above would be easy to widen
into swallowing genuine failures.
On either failure the task list is now dumped via docker stack ps. The
per-service log only reports changes, so working out which service
stalled previously meant reading back through the whole log.
Not included: passing --detach=false to docker stack deploy, suggested
on the second issue. It would make deploy block until convergence, which
replaces this script's configurable timeout with docker's own waiting
and could hang on precisely the services above. Worth its own
discussion rather than folding in here.
Closes#13Closes#19
0 commit comments