Github user jianbzhou commented on the issue:

    https://github.com/apache/storm/pull/1131
  
    @hmcl, today we found one NullpointerException and i applied a fix as below:
    
    In method doSeekRetriableTopicPartitions, if one partition was never 
committed before one message is failed back, we will encounter below issue. 
Could you please help review and let me know if this fix is oaky?
    
    **Code change is as below -from**
    
    //  kafkaConsumer.seekToEnd(rtp);    // Seek to last committed offset
    OffsetAndMetadata commitOffset = kafkaConsumer.committed(rtp);
    kafkaConsumer.seek(rtp, **commitOffset.offset()**);  // Seek to last 
committed offset
    
    **to**
    //  kafkaConsumer.seekToEnd(rtp);    // Seek to last committed offset
    OffsetAndMetadata commitOffset = kafkaConsumer.committed(rtp);
    if(commitOffset != null){
        kafkaConsumer.seek(rtp, commitOffset.offset());  // Seek to last 
committed offset
    } else{
        LOG.info("In doSeekRetriableTopicPartitions, topic partition is {}, no 
offset was committed for this partition, will seek back to the initial offset 
{}", rtp, offsetEntry.initialFetchOffset);
        kafkaConsumer.seek(rtp, offsetEntry.initialFetchOffset); //no offset 
committed for this partition, seek to the original fetch offset
    }



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to