missionary

Eric Dvorsak 2024-04-08T15:51:13.744209Z

I'm getting an interesting Exception in a missionary task:

[{:type java.lang.InterruptedException
   :message nil
   :at [java.util.concurrent.locks.AbstractQueuedSynchronizer tryAcquireSharedNanos "AbstractQueuedSynchronizer.java" 1133]}]
 :trace
 [[java.util.concurrent.locks.AbstractQueuedSynchronizer tryAcquireSharedNanos "AbstractQueuedSynchronizer.java" 1133]
  [java.util.concurrent.CountDownLatch await "CountDownLatch.java" 276]
  [clojure.core$promise$reify__8591 deref "core.clj" 7182]
  [clojure.core$deref invokeStatic "core.clj" 2341]
  [clojure.core$deref invoke "core.clj" 2323]
  [taoensso.encore$eval3772$get_hostname__3773 invokePrim "encore.cljc" 5621]
  [taoensso.timbre$get_hostname invokeStatic "timbre.cljc" 329]
  [taoensso.timbre$get_hostname invoke "timbre.cljc" 329]
  [taoensso.timbre$_log_BANG_$fn__4978 invoke "timbre.cljc" 483]
Seems like it is called by timbre when logging, it tries to get the hostname which uses encore, then some promise, which I suspect is interrupted by missionary Timbre is not safe to use with missionary?

Eric Dvorsak 2024-04-09T07:33:56.779089Z

does it necessarily mean the task was cancelled or could it be that the task was parked?

Eric Dvorsak 2024-04-09T07:35:55.974939Z

it goes like this: (defn logged-task [] (m/via m/blk (do (log/info "logged throwing exception) (http-request))) then (m/? (logged-task))

Eric Dvorsak 2024-04-09T07:42:55.515619Z

after moving the log out of the via I don't get the error anymore obviously, and it is probably more correct, but if it was happening because the task was cancelled I have a problem

leonoel 2024-04-09T10:03:40.285949Z

What is the context of (m/? (logged-task)) ? If it's from a plain thread then check if it's been interrupted, if it's from a coroutine context then it must have been cancelled somehow

Eric Dvorsak 2024-04-09T11:26:08.124429Z

@leonoel yeah I realized that it was actually interrupted because higher up m/reduce call was malformed

leonoel 2024-04-08T15:55:52.971199Z

is it called in a m/via ?

Eric Dvorsak 2024-04-08T15:58:57.726059Z

Yes

leonoel 2024-04-08T16:05:32.686519Z

When a m/via task is cancelled, the thread running it is interrupted, at which point blocking calls are expected to throw InterruptedException. Most likely your task has a timbre call somewhere in a finally block, which fails because host resolution is blocking.

Eric Dvorsak 2024-04-08T16:12:32.235079Z

Interesting so that would mean im accidently cancelling tasks

leonoel 2024-04-08T16:14:23.337339Z

yes I would check that first