                              (finally
                                (.release semaphore)))))
     (catch RejectedExecutionException e
-      (log/error e "Message not submitted to command processing threadpool")
+      (log/error e (i18n/trs "Message not submitted to command processing threadpool"))
       (.release semaphore))))
 
 (defn exec-from-channel

  ;; This will block, waiting for the threadpool to shutdown
  (when-not (.awaitTermination threadpool shutdown-timeout java.util.concurrent.TimeUnit/MILLISECONDS)

    (log/warn "Attempted to shutdown threadpool, not stopped after 5 minutes, forcibly shutting it down")

    ;; This will force the shutdown of the threadpool and will
    ;; not allow current threads to finish
    (.shutdownNow threadpool)
    (log/warn "Threadpool forcibly shutdown")))

(defrecord GatedThreadpool [^Semaphore semaphore ^ExecutorService threadpool shutdown-timeout]
  java.io.Closeable


(defn shutdown
  "Shuts down the gated threadpool, ensuring in-flight work is
  complete before tearing it down. Waits up to `shutdown-timeout` (in
  milliseconds) for that work to complete before forcibly shutting
  down the threadpool that work to complete"
  [{:keys [^Semaphore semaphore ^ExecutorService threadpool shutdown-timeout]}]

  ;; Prevent new work from being accepted
