                                                 context
                                                 read-db
                                                 service
-                                                shutdown-on-error)
+                                                request-shutdown)
                          job-pool))
           (when (pos? gc-interval-millis)
             (let [request (db-config->clean-request database)]


          ;; Unrecognized -- pass it on.
          (throw ex))))))

(defprotocol PuppetDBServer
  (shared-globals [this])


                       :else
                       (throw (Exception. "Unknown state when checking schema versions")))]
          (request-shutdown {::tk/exit
                             {:status 1  ;; Unsuppported by older TK (will be 1)
                              :messages [[ex-msg *err*]]}}))))))

(defn start-puppetdb
  "Throws {:kind ::unsupported-database :current version :oldest version} if
  the current database is not supported. If a database setting is configured
  incorrectly, throws {:kind ::invalid-database-configuration :failed-validation failed-map}"
  [context config service get-registered-endpoints request-shutdown]
  (let [{:keys [developer jetty
                database read-database
                puppetdb command-processing
