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

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

I tried adding locking as a temporary fix. This eliminated the 
IndexOutOfBoundsException, but the NullPointerException remains (albeit with 
slightly different line numbers due to running v0.9.2-incubating-SNAPSHOT):

{code}
java.lang.RuntimeException: java.lang.NullPointerException
    at 
backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:107)
    at 
backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:78)
    at 
backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:77)
    at 
backtype.storm.disruptor$consume_loop_STAR_$fn__1577.invoke(disruptor.clj:89)
    at backtype.storm.util$async_loop$fn__384.invoke(util.clj:433)
    at clojure.lang.AFn.run(AFn.java:24)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
    at 
backtype.storm.serialization.KryoTupleSerializer.serialize(KryoTupleSerializer.java:41)
    at 
backtype.storm.daemon.worker$mk_transfer_fn$fn__4217$fn__4221.invoke(worker.clj:123)
    at backtype.storm.util$fast_list_map.invoke(util.clj:832)
    at 
backtype.storm.daemon.worker$mk_transfer_fn$fn__4217.invoke(worker.clj:123)
    at 
backtype.storm.daemon.executor$start_batch_transfer__GT_worker_handler_BANG_$fn__3746.invoke(executor.clj:255)
    at 
backtype.storm.disruptor$clojure_handler$reify__1560.onEvent(disruptor.clj:58)
    at 
backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:104)
    ... 6 more
{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