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

ASF GitHub Bot commented on STORM-1937:
---------------------------------------

Github user satishd commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1531#discussion_r69145885
  
    --- Diff: 
storm-core/src/jvm/org/apache/storm/trident/windowing/WindowTridentProcessor.java
 ---
    @@ -163,11 +163,14 @@ public void finishBatch(ProcessorContext 
processorContext) {
             Iterable<Object> triggerValues = null;
     
             if (retriedAttempt(batchId)) {
    -            pendingTriggerIds = (List<Integer>) 
windowStore.get(inprocessTriggerKey(batchTxnId));
    -            for (Integer pendingTriggerId : pendingTriggerIds) {
    -                triggerKeys.add(triggerKey(pendingTriggerId));
    +            Object triggerIds = 
windowStore.get(inprocessTriggerKey(batchTxnId));
    --- End diff --
    
    @wangperry Can you remove creating one more variable. You need to wrap with 
a simple null check like below.
    
    ```java
    if(pendingTriggerIds != null)  {
        for (Integer pendingTriggerId : pendingTriggerIds) {
          triggerKeys.add(triggerKey(pendingTriggerId));
       }
       triggerValues = windowStore.get(triggerKeys);
    }
    ```


> trident topologies WindowTridentProcessor cause NullPointerException when 
> using windowing
> -----------------------------------------------------------------------------------------
>
>                 Key: STORM-1937
>                 URL: https://issues.apache.org/jira/browse/STORM-1937
>             Project: Apache Storm
>          Issue Type: Bug
>          Components: storm-core
>    Affects Versions: 1.0.0, 1.0.1
>            Reporter: perry wang
>         Attachments: v0.1.patch
>
>
> I'm working with trident and try to use windows support, under the local 
> model is fine, but in distributed mode we got the following excepiton(I can 
> reliably reproduce this issue):
> java.lang.RuntimeException: java.lang.NullPointerException
>       at 
> org.apache.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:452)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:418)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:73)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.daemon.executor$fn__7953$fn__7966$fn__8019.invoke(executor.clj:847)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at org.apache.storm.util$async_loop$fn__625.invoke(util.clj:484) 
> [storm-core-1.0.1.jar:1.0.1]
>       at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
>       at java.lang.Thread.run(Thread.java:744) [?:1.7.0_51]
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.storm.trident.windowing.WindowTridentProcessor.finishBatch(WindowTridentProcessor.java:167)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.trident.planner.SubtopologyBolt.finishBatch(SubtopologyBolt.java:151)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.trident.topology.TridentBoltExecutor.finishBatch(TridentBoltExecutor.java:266)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.trident.topology.TridentBoltExecutor.checkFinish(TridentBoltExecutor.java:299)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.trident.topology.TridentBoltExecutor.execute(TridentBoltExecutor.java:378)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.daemon.executor$fn__7953$tuple_action_fn__7955.invoke(executor.clj:728)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.daemon.executor$mk_task_receiver$fn__7874.invoke(executor.clj:461)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.disruptor$clojure_handler$reify__7390.onEvent(disruptor.clj:40)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       at 
> org.apache.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:439)
>  ~[storm-core-1.0.1.jar:1.0.1]
>       ... 6 more



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to