[
https://issues.apache.org/jira/browse/BEAM-6424?focusedWorklogId=189056&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-189056
]
ASF GitHub Bot logged work on BEAM-6424:
----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Jan/19 16:41
Start Date: 23/Jan/19 16:41
Worklog Time Spent: 10m
Work Description: jbonofre 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 PR avoid a NPE when getWatermark() is called in early stage.
------------------------
Follow this checklist to help us incorporate your contribution quickly and
easily:
- [X] Format the pull request title like `[BEAM-XXX] Fixes bug in
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA
issue, if applicable. This will automatically link the pull request to the
issue.
- [X] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
It will help us expedite review of your Pull Request if you tag someone
(e.g. `@username`) to look at it.
Post-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark
--- | --- | --- | --- | --- | --- | --- | ---
Go | [](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/)
| --- | --- | --- | --- | --- | ---
Java | [](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)
Python | [](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/)
| --- | [](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)
</br> [](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/)
| --- | --- | --- | ---
----------------------------------------------------------------
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: 189056)
Time Spent: 10m
Remaining Estimate: 0h
> 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-ideas
> Reporter: Augustin Lafanechere
> Assignee: Jean-Baptiste Onofré
> Priority: Minor
> Time Spent: 10m
> 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)