This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-07
Channels
- # announcements (37)
- # babashka (28)
- # beginners (104)
- # calva (28)
- # cider (32)
- # clj-kondo (35)
- # cljs-dev (4)
- # cljsrn (3)
- # clojure (35)
- # clojure-conj (4)
- # clojure-dev (57)
- # clojure-europe (4)
- # clojure-france (6)
- # clojure-gamedev (1)
- # clojure-germany (1)
- # clojure-hamburg (2)
- # clojure-italy (7)
- # clojure-nl (4)
- # clojure-spec (9)
- # clojure-uk (11)
- # clojuredesign-podcast (2)
- # clojurescript (36)
- # clojurex (48)
- # core-async (6)
- # cursive (12)
- # data-science (1)
- # datomic (21)
- # defnpodcast (7)
- # duct (1)
- # events (1)
- # fulcro (56)
- # graalvm (30)
- # graphql (5)
- # jobs (1)
- # joker (21)
- # keechma (1)
- # leiningen (4)
- # off-topic (109)
- # parinfer (20)
- # pathom (27)
- # re-frame (4)
- # shadow-cljs (80)
- # spacemacs (18)
- # sql (32)
- # testing (2)
- # tools-deps (32)
- # vim (20)
hello @dansudol, are you using the pathom-datomic package, or doing the integration with regular resolver?
honestly not 100% sure Wilker ..
but I found the issue was with a particular join query
it seems to work fine in production but not locally
it is truely bizzarre and i think you might have more insight than i
can you show the query that you see trouble? did you tried to debug using the pathom trace?
@dansudol With Pathom I have seen execution on the server just halting, with no error being reported. For example I recently had this problem when server code did a select-keys
with the 2nd arg being a keyword rather than a vector as it is supposed to be. I only got to see the error by calling the code directly, outside of Pathom. The issue is that core.async
errors are not reported to the thread/REPL you are running in. If Pathom could be run without using core.async
I believe this error message (for bad select-keys
call) would have been seen in the REPL. I think that this kind of problem will be fixed when spec becomes a part of Clojure, as ordinary functions will then be checked. At the moment I can see that guardrails/Ghostwheel issues are reported by expound - so spec works with Pathom. Another thing is that just regular asserts will also not show up, although you can get around this by having your own assert macro that writes the message and stack trace to a file before throwing the AssertionError.
for debugging this case of thing, I suggest you try to use the serial parser, I'm actually starting to think the serial is a better general recommendation than the parallel, its simpler to understand and debug, and I believe most people are not taking that much out of the parallel (you need to have a fair amount of parallelism opportunity to get significant gains with that)
at Nubank we have extra setup to get errors reported in a more systematic way, you can use the ::p/process-error
to setup a custom error handler, that works with both serial and parallel, from that I suggest you can log the errors in some source you can lookup later
good suggest about logging errors chris and i am trying serial parser now
also I have set up what I thought was error reporting this way
::p/plugins [(pc/connect-plugin {::pc/register (vec (vals @pathom-registry))})
(p/env-wrap-plugin
(fn [{:keys [conn] :as env}]
(merge env {:config
config
::p/process-error
(fn [_ err]
; print stack trace
(.printStackTrace err)
; return error str
(p/error-str err))})))
(preprocess-parser-plugin log-requests)
(p/post-process-parser-plugin p/elide-not-found)
;p/request-cache-plugin
p/error-handler-plugin
p/trace-plugin]
but it is not throwing out any errors
actually when switching to serial parser i got an error
java.lang.IllegalArgumentException: No implementation of method: :take! of protocol: #'clojure.core.async.impl.protocols/ReadPort found for class: clojure.lang.PersistentArrayMap
so i switching back to parralel
@dansudol about the switch, you also need to switch the reader, instead of pc/parallel-reader
you should use pc/reader2
also the mutation fn must be changed, from pc/mutate-async
to pc/mutate
Wow .. @U066U8JQJ thank goodness you reminded me about those 2 methods ( even without looking at my setup ) that is what I had
I also had this
(fn wrapped-parser [env tx]
(async/<!! (real-parser env (if trace?
(conj tx :com.wsscode.pathom/trace)
tx))))
yeah, that needs to change, the serial returns a regular map, simpler stuff 🙂
so you can see why it was barfing .. gosh .. amazing .. but your idea helped me out
i changed to
(fn wrapped-parser [env tx]
(real-parser env (if trace?
(conj tx :com.wsscode.pathom/trace)
tx)))
everything works now .. amazing
glad to hear 🙂