   not a normal shutdown, emergency? must be set, which currently just
   produces a fatal level level log message, instead of info."
   [{:keys [stop-status] :as context}]
-  (log/info (trs "Shutdown request received; puppetdb exiting."))
-  (when-let [pool (:job-pool context)]
-    (stop-and-reset-pool! pool))
-  ;; Wait up to ~5s for https://bugs.openjdk.java.net/browse/JDK-8176254
-  (swap! stop-status assoc :stopping true)
-  (if (utils/await-ref-state stop-status ready-to-stop? (stop-gc-wait-ms) false)
-    (log/info (trs "Periodic activities halted"))
-    (log/info (trs "Forcibly terminating periodic activities")))
-  (close-write-dbs (get-in context [:shared-globals :scf-write-dbs]))
-  (when-let [ds (get-in context [:shared-globals :scf-read-db :datasource])]
-    (.close ^Closeable ds))
-
-  (when-let [command-loader (:command-loader context)]
-    (future-cancel command-loader))
-  context)
+  (try!
+   (log/info (trs "Shutdown request received; puppetdb exiting."))
+   context
+   (finally (some-> (:job-pool context) stop-and-reset-pool!))
+   (finally
+     ;; Wait up to ~5s for https://bugs.openjdk.java.net/browse/JDK-8176254
+     (swap! stop-status assoc :stopping true)
+     (if (utils/await-ref-state stop-status ready-to-stop? (stop-gc-wait-ms) false)
+       (log/info (trs "Periodic activities halted"))
+       (log/info (trs "Forcibly terminating periodic activities"))))
+   (finally (close-write-dbs (get-in context [:shared-globals :scf-write-dbs])))
+   (finally (some-> (get-in context [:shared-globals :scf-read-db :datasource])
+                    .close))
+   (finally (some-> (:command-loader context) future-cancel))
+   (finally (some-> (:cmd-event-ch context) async/close!))
+   (finally (some-> (:cmd-event-mult context) async/untap-all))
+   (finally (stop-reporters metrics/metrics-registries))))
 
 ;; A map of required postgres settings and their expected value.
 ;; PuppetDB will refuse to start unless ALL of these values

            [metrics.gauges :refer [gauge-fn]]
            [metrics.timers :refer [time! timer]]
            [metrics.reporters.jmx :as jmx-reporter]
            [murphy :refer [with-final]]
            [overtone.at-at :refer [mk-pool every interspaced stop-and-reset-pool!]]
            [puppetlabs.i18n.core :refer [trs tru]]
            [puppetlabs.kitchensink.core :as kitchensink]

                               get-registered-endpoints
                               (shutdown-requestor request-shutdown this)))

  (stop [this context] (stop-puppetdb context))

  (set-url-prefix [this url-prefix]
                  (let [old-url-prefix (:url-prefix (service-context this))]
