-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Using upmap
sometimes results in this exception:
java.lang.NullPointerException: Cannot invoke "java.util.concurrent.Future.get()" because "fut" is null
core.clj:2317 clojure.core / deref_future
core.clj:2337 clojure.core / deref
impl.clj:58 com.climate.claypoole.impl / deref_fixing_exceptions
impl.clj:58 com.climate.claypoole.impl / deref_fixing_exceptions
It appears that pmap-core
zips the ordered tasks with an unordered queue of derefable results of those tasks, and sometimes the second value (returned by a blocking take from the unordered queue) returns nil, causing deref-fixing-exceptions
to deref that nil value, throwing the above exception.
So, something in the implementation of the blocking take from the unordered queue is causing it to return nil. I can only guess this is a race condition because it seemed to happen randomly. Anecdotally, I saw it happening more in 1.1.4 than in 1.2.2.
I don’t have steps to reproduce, but we fixed the issue in our system by just switching from upmap
to pmap
, which avoids what I think is the problematic zip operation above.