Skip to content

Commit

Permalink
[GH-1277] Prevent update loop from terminating (#364)
Browse files Browse the repository at this point in the history
Catch all throwables to make sure a workload failure doesn't bring down
workflow-launcher.
  • Loading branch information
ehigham committed Apr 12, 2021
1 parent 147a964 commit 8e4296e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions api/src/wfl/server.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
[wfl.service.postgres :as postgres]
[wfl.util :as util]
[wfl.wfl :as wfl])
(:import (java.util.concurrent Future TimeUnit)
(org.postgresql.util PSQLException)))
(:import (java.util.concurrent Future TimeUnit)))

(def description
"The purpose of this command."
Expand Down Expand Up @@ -88,9 +87,9 @@
(jdbc/with-db-transaction [tx (postgres/wfl-db-config)]
(->> (workloads/load-workload-for-id tx id)
(workloads/update-workload! tx)))
(catch PSQLException ex
(catch Throwable t
(log/warnf "Failed to update workload %s" uuid)
(log/warn ex))))
(log/warn t))))
(update-workloads! []
(log/info "updating workloads")
(run! do-update!
Expand Down

0 comments on commit 8e4296e

Please sign in to comment.