[ 
https://issues.apache.org/jira/browse/BEAM-6424?focusedWorklogId=190634&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-190634
 ]

ASF GitHub Bot logged work on BEAM-6424:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Jan/19 20:52
            Start Date: 27/Jan/19 20:52
    Worklog Time Spent: 10m 
      Work Description: iemejia commented on pull request #7602: [BEAM-6424] 
Avoid NPE when getWatermark() is called whereas the oldest timestamp is not yet 
set
URL: https://github.com/apache/beam/pull/7602
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 190634)
    Time Spent: 20m  (was: 10m)

> RabbitMqIO: NullPointerException raised on getWatermark() first call
> --------------------------------------------------------------------
>
>                 Key: BEAM-6424
>                 URL: https://issues.apache.org/jira/browse/BEAM-6424
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-rabbitmq
>            Reporter: Augustin Lafanechere
>            Assignee: Jean-Baptiste Onofré
>            Priority: Minor
>             Fix For: 2.11.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> I tried to use the RabbitMqIO with the direct runner to generate an unbounded 
> PCollection from a queue. I encounter a NPE :
> {quote}{{java.lang.NullPointerException}}
> {{ at 
> org.apache.beam.runners.direct.UnboundedReadEvaluatorFactory$UnboundedReadEvaluator.processElement
>  (UnboundedReadEvaluatorFactory.java:169)}}
> {{....}}
> {quote}
> After investigation it looks like it's caused by the fact that no default is 
> given to 
> checkpointMark.oldestTimestamp. getWatermark() is called before the mutation 
> of the currentTimestamp variable, raising a NPE. I fixed the problem on my 
> side, reimplementing the class and overriding getWatermark to return 
> Instant.now()  if checkpointMark.oldestTimestamp is null :
> {quote}@Override
> publicInstantgetWatermark() {
>   if (checkpointMark.oldestTimestamp == null) {
>     returnInstant.now();
>   }
>   return checkpointMark.oldestTimestamp;
> }{quote}
> It looks likes this bug as [already been raised 
> here|https://jira.apache.org/jira/browse/BEAM-1240?focusedCommentId=16566869&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16566869]
>  on the PR for RabbitMqIO.
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to