This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-14
Channels
- # aleph (16)
- # bangalore-clj (4)
- # beginners (19)
- # boot (27)
- # cider (81)
- # clara (2)
- # cljs-dev (343)
- # cljsrn (97)
- # clojure (224)
- # clojure-hk (1)
- # clojure-italy (25)
- # clojure-russia (5)
- # clojure-serbia (2)
- # clojure-spec (7)
- # clojure-uk (27)
- # clojurescript (97)
- # cursive (8)
- # datomic (48)
- # docker (1)
- # emacs (15)
- # hoplon (39)
- # jobs (4)
- # lumo (13)
- # off-topic (2)
- # om (66)
- # onyx (7)
- # parinfer (5)
- # pedestal (2)
- # play-clj (10)
- # protorepl (2)
- # quil (1)
- # re-frame (38)
- # reagent (33)
- # spacemacs (1)
- # specter (4)
- # sql (19)
- # test-check (31)
- # unrepl (4)
- # untangled (3)
I have been wrestling with some kind of memory/reference leak using Aleph and JanusGraph in tandem
I have done some research and it looks like part of the problem is that Janus transactions are thread specific
For instance, I am doing this
(stream/on-drained
source
(fn []
(log/debug "query complete")
(db/commit graph)
(db/rollback graph)))
But how do I guarantee this function is being called on the same thread that the transaction was opened on?
Do the on-drained
callbacks always get called from the same thread that the handler is using?
@spangler I'm not exactly sure, but http://aleph.io/manifold/execution.html might be helpful
> Almost all interaction with JanusGraph is associated with a transaction. JanusGraph transactions are safe for concurrent use by multiple threads. Methods on a JanusGraph instance like graph.v(...) and graph.commit() perform a ThreadLocal lookup to retrieve or create a transaction associated with the calling thread. Callers can alternatively forego ThreadLocal transaction management in favor of calling graph.newTransaction(), which returns a reference to a transaction object with methods to read/write graph data and commit or rollback. I think that might be what you need to do?
@danielcompton Thank you! I now have some leads to follow. I will report back work how it turns out.