missionary

Eric Dvorsak 2024-06-27T08:04:03.543699Z

First time I notice, missionary doesn't always work with honeysql:

(m/? (let [id 1] (m/sp (sql/format {:select [:*] :from :table :where [:= :id id]}))))
Execution error (ClassCastException) at honey.sql/sql-kw (sql.cljc:342).
class java.lang.Class cannot be cast to class clojure.lang.Named (java.lang.Class is in module java.base of loader 'bootstrap'; clojure.lang.Named is in unnamed module of loader 'app')

Eric Dvorsak 2024-06-27T08:25:03.397619Z

Looks like it is caused by the addition of meta. I added some print statements and got this:

(m/? (let [id 1] (m/sp (sql/format {:select [:*] :from :table :where [:= :id id]}))))
:k :select
:x [:*]
:meta {:tag clojure.lang.PersistentVector}
:k :tag
:k clojure.lang.PersistentVector

Eric Dvorsak 2024-06-27T08:39:39.974609Z

I had to add {:ignored-metadata [:tag]} to honeysql/format

👀 1
leonoel 2024-10-16T20:29:50.888639Z

@hoertlehner do you have a repro for the timbre issue ?

awb99 2024-10-16T23:47:57.576229Z

@leonoel Sorry, I dont. What I did is replace timbre with telemere in functions that caused missionary to fail, and that solved the issue. What I do remember is that there is at least part of the logging that is happening synchronous, namely the lookup of the hostname. And in this call timbre is blocking, and that was interferring with missionary. I doubt that timbre will get fixed, as the successor library telemere is already out, this is why I did not care. But my codebase is 150.000 clojure lines, and there is still a lot of timbre logging going on. I am gradually introducing missionary to my codebase, and what I can easily do is not replace any existing timre logging, and in case this error reappears, then save detailed stacktraces at least. Would this be helpful?

leonoel 2024-10-17T06:10:27.759149Z

yes a stacktrace would definitely help

Eric Dvorsak 2024-10-17T06:18:51.051709Z

@hoertlehner but what do you mean by similar problem? It was a ClassCastException? Otherwise what was similar about it? I have never had any issue between timbre and missionary except that one time i made a bad reduction that terminated early due to an error. What timbre doesnt like is if the thread is interrupted while its looking up the hostname

Absolute Negativity 2024-10-15T13:55:08.425419Z

I just run into this too. :ignored-metadata didn't work in my case, not sure why, ended up doing (vary-meta select-clause (constantly nil)).

(defn foo [jdbc select]
    (jdbc/execute! jdbc
      (sql/format
        {:from   :products
         :select (vary-meta select (constantly nil))}
        ;; {:ignored-metadata [:tag]} ; still err
        )))

  (m/? (m/sp (foo a-jdbc [:*])))

leonoel 2024-10-15T18:35:16.347539Z

I filed an issue https://github.com/leonoel/missionary/issues/119

awb99 2024-10-15T23:02:41.531299Z

I have Noticed a problem similar to the one on honeysql with both datahike and timbre. Datahike should be fixed now. Timbre is not working. It would be great if @leonoel could elaborate as to how/why this would happen. It must be something that happens when inside a missionary task this external libraries use thread blocking that somehow interfers with missionary thread management.

2024-06-27T12:45:27.899079Z

I'm trying to do interop with http://deck.gl to sync two viewports in a clever way. I am using a mbx to push the onViewChange events to. I figured this can be turned into a continuous value by relieving the mbx. But I noticed something curious, as soon as I turn this relieving ap flow into either a signal or a stream, http://deck.gl has issues with the viewport, even before a "controlled" view-state prop is set. Is it possible that m/signal and m/stream somehow stop the event from being used in the normal event handling for viewChanges?

leonoel 2024-06-27T14:17:23.860729Z

there may be something wrong with your graph setup, can you reproduce the bug without http://deck.gl ?

2024-06-27T14:37:10.175559Z

Hmm, that's going to be tricky as there are no errors but http://deck.gl seems to have an issue with the subsequent viewport events when I consume the mbx with signal/stream. I was wondering if somehow it could discard the event object and it's used by http://deck.gl. (It shouldn't imo, but since it's going from react's uncontrolled to controlled there might be something that goes on with that event). It's not important enough to figure out now. I've resorted to just an ap loop and racing on the mbx's and that seems to work for my use-cases for now. Thanks.