[ https://issues.apache.org/jira/browse/BEAM-5197?focusedWorklogId=170357&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-170357 ]
ASF GitHub Bot logged work on BEAM-5197: ---------------------------------------- Author: ASF GitHub Bot Created on: 28/Nov/18 18:36 Start Date: 28/Nov/18 18:36 Worklog Time Spent: 10m Work Description: mxm closed pull request #7152: [BEAM-5197] Fix possible overflow of timestamp for processing timer URL: https://github.com/apache/beam/pull/7152 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/UnboundedSourceWrapper.java b/runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/UnboundedSourceWrapper.java index 1595a95d0242..333113a9988f 100644 --- a/runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/UnboundedSourceWrapper.java +++ b/runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/UnboundedSourceWrapper.java @@ -443,9 +443,15 @@ private void setNextWatermarkTimer(StreamingRuntimeContext runtime) { if (this.isRunning) { long watermarkInterval = runtime.getExecutionConfig().getAutoWatermarkInterval(); synchronized (context.getCheckpointLock()) { - long timeToNextWatermark = - runtime.getProcessingTimeService().getCurrentProcessingTime() + watermarkInterval; - runtime.getProcessingTimeService().registerTimer(timeToNextWatermark, this); + long currentProcessingTime = runtime.getProcessingTimeService().getCurrentProcessingTime(); + if (currentProcessingTime < Long.MAX_VALUE) { + long nextTriggerTime = currentProcessingTime + watermarkInterval; + if (nextTriggerTime < currentProcessingTime) { + // overflow, just trigger once for the max timestamp + nextTriggerTime = Long.MAX_VALUE; + } + runtime.getProcessingTimeService().registerTimer(nextTriggerTime, this); + } } } } ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 170357) Time Spent: 6h 50m (was: 6h 40m) > Flaky test: UnboundedSourceWrapperTest$ParameterizedUnboundedSourceWrapperTest > ------------------------------------------------------------------------------ > > Key: BEAM-5197 > URL: https://issues.apache.org/jira/browse/BEAM-5197 > Project: Beam > Issue Type: Improvement > Components: runner-flink > Reporter: Thomas Weise > Assignee: Maximilian Michels > Priority: Critical > Labels: flake > Fix For: 2.10.0 > > Time Spent: 6h 50m > Remaining Estimate: 0h > > {code:java} > java.lang.NullPointerException > at > org.apache.flink.streaming.runtime.tasks.TestProcessingTimeService$1.compare(TestProcessingTimeService.java:52) > at > org.apache.flink.streaming.runtime.tasks.TestProcessingTimeService$1.compare(TestProcessingTimeService.java:49) > at java.util.PriorityQueue.siftUpUsingComparator(PriorityQueue.java:670) > at java.util.PriorityQueue.siftUp(PriorityQueue.java:646) > at java.util.PriorityQueue.offer(PriorityQueue.java:345) > at > org.apache.flink.streaming.runtime.tasks.TestProcessingTimeService.registerTimer(TestProcessingTimeService.java:93) > at > org.apache.beam.runners.flink.translation.wrappers.streaming.io.UnboundedSourceWrapper.setNextWatermarkTimer(UnboundedSourceWrapper.java:452) > at > org.apache.beam.runners.flink.translation.wrappers.streaming.io.UnboundedSourceWrapper.run(UnboundedSourceWrapper.java:225) > at > org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:87) > at > org.apache.beam.runners.flink.streaming.UnboundedSourceWrapperTest$ParameterizedUnboundedSourceWrapperTest.testValueEmission(UnboundedSourceWrapperTest.java:153) > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)