This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-06
Channels
- # announcements (37)
- # babashka (17)
- # beginners (20)
- # calva (2)
- # clj-kondo (15)
- # cljs-dev (1)
- # clojure (6)
- # clojure-austin (2)
- # clojure-china (3)
- # clojure-europe (27)
- # clojure-korea (1)
- # clojure-nl (1)
- # clojure-norway (18)
- # clojurescript (13)
- # conjure (3)
- # datomic (31)
- # events (3)
- # honeysql (14)
- # jobs-discuss (33)
- # leiningen (4)
- # lsp (57)
- # membrane (3)
- # missionary (5)
- # off-topic (1)
- # releases (3)
- # shadow-cljs (18)
- # slack-help (2)
- # specter (2)
- # yamlscript (10)
I got java.lang.InterruptedException
when running this form with Datomic.
(m/?
(m/sp
(m/? (m/race
(m/via m/blk
@(dm/transact-async db-conn [{:db/ident :user/name}]))))
(m/? (m/sp (println (dm/db db-conn))))))
Taking m/race
out works however:
(m/?
(m/sp
(m/? (m/via m/blk
@(dm/transact-async db-conn [{:db/ident :user/name}])))
(m/? (m/sp (println (dm/db db-conn))))))
Does anyone know what's wrong?
Here is the stack trace:
1. Unhandled java.lang.InterruptedException
(No message)
AbstractQueuedSynchronizer.java: 1100 java.util.concurrent.locks.AbstractQueuedSynchronizer/acquireSharedInterruptibly
CountDownLatch.java: 230 java.util.concurrent.CountDownLatch/await
core.clj: 7199 clojure.core/promise/reify
core.clj: 2337 clojure.core/deref
core.clj: 2323 clojure.core/deref
peer.clj: 59 datomic.peer/get-cstate
peer.clj: 56 datomic.peer/get-cstate
peer.clj: 283 datomic.peer.Connection/db
api.clj: 73 datomic.api/db
api.clj: 71 datomic.api/db
REPL: 301 <my-domain>/eval2530684/cr2530685-block-1/cr2530685-place-8
impl.cljc: 60 cloroutine.impl$coroutine$fn__12664/invoke
Sequential.java: 88 missionary.impl.Sequential/step
Sequential.java: 125 missionary.impl.Sequential/run
core.cljc: 187 missionary.core$sp_run/invokeStatic
core.cljc: 186 missionary.core$sp_run/invoke
impl.cljc: 65 cloroutine.impl$coroutine$fn__12664/invoke
core.clj: 2642 clojure.core/partial/fn
Sequential.java: 74 missionary.impl.Sequential/suspend
Sequential.java: 40 missionary.impl.Sequential$Process/park
Fiber.java: 85 missionary.impl.Fiber/park
core.cljc: 174 missionary.core$park/invokeStatic
core.cljc: 173 missionary.core$park/invoke
REPL: 297 <my-domain>/eval2530684/cr2530685-block-1
impl.cljc: 60 cloroutine.impl$coroutine$fn__12664/invoke
Sequential.java: 88 missionary.impl.Sequential/step
Sequential.java: 112 missionary.impl.Sequential$1/invoke
RaceJoin.java: 51 missionary.impl.RaceJoin/terminated
RaceJoin.java: 71 missionary.impl.RaceJoin$1/invoke
RaceJoin.java: 86 missionary.impl.RaceJoin$2/invoke
Thunk.java: 59 missionary.impl.Thunk$Process/run
Try latest version, there is a recent fix related to m/via
cancellation and thread interruption state. You could also consider calling (dm/db db-conn)
in a m/via
as it's a blocking call
❤️ 1
Ok that's a fix. Thank you!
dm/db
from the doc says it doesn't block?
"Retrieves a value of the database for reading. Does not
communicate with the transactor, nor block."
Well I guess judging from my stack trace, it derefs promise hence it blocks...