]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: --stop-signal=SIGTERM
authorSage Weil <sage@newdream.net>
Thu, 6 May 2021 14:57:46 +0000 (10:57 -0400)
committerSage Weil <sage@newdream.net>
Tue, 25 May 2021 14:15:45 +0000 (10:15 -0400)
haproxy's container image tells docker|podman to send SIGUSR1 for a "clean"
shutdown.  For NFS, the connections never close, so we will always hit the
podman|docker 10s timeout and get a SIGKILL.  That, in turn, causes haproxy
to exit with 143, and puts the systemd unit in a failed state.

This highlights a general problem(?) with stopping containers: if they don't
do it quickly then we'll end up in this error state.  We don't directly
address that here.

Avoid this problem by always stopping containers with SIGTERM.  In the
haproxy case, that means an immediate shutdown (no graceful drain of
open connections).  In theory we could do this only for haproxy with
NFS, but we can easily imagine RGW connections that don't close in 10s
either, and we don't want containers exiting in error state--we just
want the proxy to stop quickly.

Signed-off-by: Sage Weil <sage@newdream.net>
src/cephadm/cephadm

index e4086a423a27a28ad953117e5c1a62cae3fba6cb..425bf6c9cea6686d684aa5d8ab3a577987a4b99a 100755 (executable)
@@ -3091,6 +3091,10 @@ class CephContainer:
             'run',
             '--rm',
             '--ipc=host',
+            # some containers (ahem, haproxy) override this, but we want a fast
+            # shutdown always (and, more importantly, a successful exit even if we
+            # fall back to SIGKILL).
+            '--stop-signal=SIGTERM',
         ]
 
         if isinstance(self.ctx.container_engine, Podman):