This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-18
Channels
- # ai (2)
- # announcements (11)
- # beginners (34)
- # biff (14)
- # clerk (14)
- # clj-kondo (25)
- # clojure (27)
- # clojure-austin (1)
- # clojure-conj (6)
- # clojure-denmark (1)
- # clojure-europe (20)
- # clojure-hamburg (1)
- # clojure-nl (1)
- # clojure-norway (28)
- # clojure-uk (2)
- # clojuredesign-podcast (6)
- # clojurescript (43)
- # cursive (4)
- # data-science (2)
- # emacs (9)
- # hyperfiddle (9)
- # introduce-yourself (2)
- # jobs (3)
- # lsp (32)
- # missionary (31)
- # nbb (8)
- # off-topic (23)
- # rdf (23)
- # re-frame (10)
- # reitit (11)
- # releases (3)
- # rewrite-clj (4)
- # shadow-cljs (7)
- # specter (6)
- # sql (7)
- # xtdb (7)
facing deadlocks after an unspecified duration from tasks started in this file https://github.com/lumberdev/tesserae/blob/master/src/tesserae/eval.clj#L311
is issue in using m/observe with the consumer not being ready to transfer? https://github.com/lumberdev/tesserae/blob/68b36f764a6839eca0e6134619f7e190fbfbe1a2/src/tesserae/eval.clj#L306-L309
if backpressure is indeed the issue, how can this be solved? I would not want to drop computation using m/relieve
if it is a backpressure issue, the callback should throw and propagate to d/transact!
not seeing any errors, instead the parts of the (electric) app deadlock requiring full app restart
of course! do you think it’s likely that this is a missionary issue or should I keep digging in my userland code?
it’s plausible. I just played more with my own code and was unable to repro the issue outside of missionary.
@U050CJFRU here is a workaround. Here https://github.com/lumberdev/tesserae/blob/68b36f764a6839eca0e6134619f7e190fbfbe1a2/src/tesserae/ui/views.cljc#L206 replace this watch with (new (async-watch db/conn))
(defn async-watch [!x]
(m/sample deref
(m/ap (m/?> (m/relieve {}
(m/observe
(fn [!]
(! nil)
(add-watch !x ! (fn [! _ _ _] (! nil)))
#(remove-watch !x !)))))
(m/? (m/via m/cpu !x)))))
The problem is datalevin calls the conn watches while holding the transaction lock, this can interlock with the reactor lock when :
• one thread transacts db outside electric, then propagates the new db state to electric
• another thread propagates a change inside electric, then transacts db
async-watch
ensures the datalevin lock is released when the new db state is propagated to electric.
I'm still not sure if the bug is in datalevin or missionary, I'll keep this scenario in mind for the next iteration.thanks @U053XQP4S getting
#error {
:cause Undefined continuous flow.
:via
[{:type java.lang.Error
:message Undefined continuous flow.
:at [missionary.impl.Continuous push Continuous.java 319]}]
(e/defn App []
(e/client
(dom/div
(dom/props {:class [:flex :flex-col :w-100vw :h-100vh :overflow-hidden]})
(e/server
(binding [g/db (new (eu/async-watch db/conn))]
(new Nav)
(new Route))))))