detached c8b7fd0

fix: reverse shutdown order — stop ingress before registry backend

Prevents 503 on manifest push during Gordon restart. Previously
registrySrv was shut down first, leaving the proxy alive and forwarding
registry traffic to a dying backend. Now TLS and proxy frontends are
stopped first, then the registry backend drains.
commit
c8b7fd097902c0cd4b310802bcb8d36dabb78743
author
brice · · 2026-03-01 11:01 UTC
committer
brice · · 2026-03-01 11:03 UTC
parent
d786451
signature
unsigned
1 file · +5 -1
M internal/app/run.go +5 -1
@@ -1956,7 +1956,11 @@ func gracefulShutdown(registrySrv, proxySrv, tlsSrv *http.Server, containerSvc *
19561956 shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 30*time.Second)
19571957 defer shutdownCancel()
19581958
1959- for _, srv := range []*http.Server{registrySrv, proxySrv, tlsSrv} {
1959+ // Shutdown order matters: stop ingress frontends (TLS, proxy) before the
1960+ // registry backend. If the backend stops first, the proxy—still alive—will
1961+ // forward registry traffic to a dead backend and return 503 on in-flight
1962+ // manifest pushes. Drain order: tlsSrv → proxySrv → registrySrv.
1963+ for _, srv := range []*http.Server{tlsSrv, proxySrv, registrySrv} {
19601964 if srv == nil {
19611965 continue
19621966 }
@@ -1956,7 +1956,11 @@ func gracefulShutdown(registrySrv, proxySrv, tlsSrv *http.Server, containerSvc *
1956 shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 30*time.Second)1956 shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 30*time.Second)
1957 defer shutdownCancel()1957 defer shutdownCancel()
1958 1958
1959- for _, srv := range []*http.Server{registrySrv, proxySrv, tlsSrv} {1959+ // Shutdown order matters: stop ingress frontends (TLS, proxy) before the
1960+ // registry backend. If the backend stops first, the proxy—still alive—will
1961+ // forward registry traffic to a dead backend and return 503 on in-flight
1962+ // manifest pushes. Drain order: tlsSrv → proxySrv → registrySrv.
1963+ for _, srv := range []*http.Server{tlsSrv, proxySrv, registrySrv} {
1960 if srv == nil {1964 if srv == nil {
1961 continue1965 continue
1962 }1966 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close