This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-17
Channels
- # announcements (1)
- # babashka (26)
- # beginners (28)
- # biff (8)
- # calva (45)
- # cider (62)
- # clara (3)
- # clj-kondo (34)
- # cljfx (1)
- # clojure (72)
- # clojure-belgium (1)
- # clojure-canada (13)
- # clojure-conj (2)
- # clojure-dev (3)
- # clojure-europe (19)
- # clojure-nl (1)
- # clojure-norway (1)
- # clojure-uk (8)
- # clojurescript (10)
- # clr (36)
- # core-logic (13)
- # cursive (2)
- # datalevin (2)
- # datomic (23)
- # fulcro (13)
- # graphql (23)
- # instaparse (1)
- # introduce-yourself (4)
- # jobs (1)
- # jobs-discuss (13)
- # lsp (30)
- # luminus (7)
- # malli (2)
- # off-topic (57)
- # polylith (13)
- # portal (5)
- # reagent (32)
- # reitit (6)
- # remote-jobs (1)
- # shadow-cljs (25)
- # xtdb (12)
I'm using transaction function to check certain invariants, when they are violated the tx-fn throws. I can see the exception in the log, and the data is not transacted, so that's good, but submit-tx returns as normal. Is there any way to know that the tx has failed? Could I perhaps even get at the message in the exception? I see the tx-id is still incremented, is that to be excepted?
ah that's already helpful. I guess there's no way to get an indication back of why it failed?
try/catch, logging and then re-throwing any errors is probably the easiest thing to do during development. The only non-side-effecting, application-visible way to observe the failure in production is to catch the error and write it into the db as data (then potentially re-throwing it...depending on the level of the error)
@U07FP7QJ0 I write a summary of the error to the database, it works fine.
looks like that's the way to go, I'll play around with it. Probably useful in general to have some "operation log" entities. Thanks for the input!
https://github.com/juxt-site/site/blob/master/src/juxt/site/actions.clj#L376 is my code that does this, if that helps. It's a rather unnecessarily long function though, apologies.
adding an audit document for every tx is a good idea too @U07FP7QJ0
Hmm. Testing index building time. On local machine between 1.20.0 and 1.23.0 it goes from 230 seconds to 70s. But on cloud run from 210s to 180s. Local machine has loads more ram and CPU, so I tested more cores. 2 cpus lowers it to 90s and 4 to 70s. Very interesting that it now can use at least two cores with almost perfect efficiency, four helping a bit more.
We've permitted more Rocks compaction jobs on multi-core machines (2 or ncpus-1, whichever is higher)