[ 
https://issues.apache.org/jira/browse/STORM-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13957182#comment-13957182
 ] 

Patrick Lucas commented on STORM-120:
-------------------------------------

Regarding the NullPointerException, it seems that a null tuple is being 
enqueued for transmission by Disruptor in this function, but I'm not familiar 
with the Storm code going up to have an intuition of where it might be coming 
from:

{code:clojure}
(defn mk-transfer-fn [worker]
  (let [local-tasks (-> worker :task-ids set)
        local-transfer (:transfer-local-fn worker)
        ^DisruptorQueue transfer-queue (:transfer-queue worker)]
    (fn [^KryoTupleSerializer serializer tuple-batch]
      (let [local (ArrayList.)
            remote (ArrayList.)]
        (fast-list-iter [[task tuple :as pair] tuple-batch]
          (if (local-tasks task)
            (.add local pair)
            (.add remote pair)
            ))
        (local-transfer local)
        ;; not using map because the lazy seq shows up in perf profiles
        (let [serialized-pairs (fast-list-for [[task ^TupleImpl tuple] remote] 
[task (.serialize serializer tuple)])]
          (disruptor/publish transfer-queue serialized-pairs)
          )))))
{code}

> util/acquire-random-range-id is not thread-safe
> -----------------------------------------------
>
>                 Key: STORM-120
>                 URL: https://issues.apache.org/jira/browse/STORM-120
>             Project: Apache Storm (Incubating)
>          Issue Type: Bug
>            Reporter: James Xu
>            Priority: Minor
>
> https://github.com/nathanmarz/storm/issues/724
> Concurrent calls to util/acquire-random-range-id with the same parameters can 
> result in an IndexOutOfBoundsException, as an increment in one thread may 
> occur after the bounds check in another. The resulting curr value can be >= 
> the size of the List state.
> https://github.com/nathanmarz/storm/blob/fc5fbb8b352cf91050cdde4a9f9e77e673ab7f48/storm-core/src/clj/backtype/storm/util.clj#L606



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to