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

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

                Author: ASF GitHub Bot
            Created on: 15/May/21 07:46
            Start Date: 15/May/21 07:46
    Worklog Time Spent: 10m 
      Work Description: je-ik commented on a change in pull request #14718:
URL: https://github.com/apache/beam/pull/14718#discussion_r632911653



##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/SimpleDoFnRunner.java
##########
@@ -1219,11 +1219,11 @@ private void setAndVerifyOutputTimestamp() {
       Instant windowExpiry = window.maxTimestamp().plus(allowedLateness);
       if (TimeDomain.EVENT_TIME.equals(spec.getTimeDomain())) {
         checkArgument(
-            !outputTimestamp.isAfter(target),
+            !outputTimestamp.isAfter(windowExpiry),

Review comment:
       GIving it one more thought, I think we should actually drop the 
Precondition for the output timestamp all together. Limiting it to any (future) 
timestamp seems inconsistent with the fact, that there is nothing stopping the 
user from using `outputWithTimestamp` and output arbitrarily future-bound 
value. The only thing the timer output timestamp actually influences is the 
output watermark. The output watermark is bound to be at most the value of 
input watermark, so setting a watermark hold to something higher is a no-op 
(semantically). Therefore this check should be removed completely.
   @kennknowles @reuvenlax WDYT?

##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/SimpleDoFnRunner.java
##########
@@ -1219,11 +1219,11 @@ private void setAndVerifyOutputTimestamp() {
       Instant windowExpiry = window.maxTimestamp().plus(allowedLateness);
       if (TimeDomain.EVENT_TIME.equals(spec.getTimeDomain())) {
         checkArgument(
-            !outputTimestamp.isAfter(target),
+            !outputTimestamp.isAfter(windowExpiry),
             "Attempted to set an event-time timer with an output timestamp of 
%s that is"
-                + " after the timer firing timestamp %s",
+                + " after the expiration of window %s",
             outputTimestamp,
-            target);
+            windowExpiry);
         checkArgument(
             !target.isAfter(windowExpiry),

Review comment:
       Yes, agree.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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: 597137)
    Time Spent: 3h 20m  (was: 3h 10m)

> Timer.withOutputTimestamp(Instant).offset(Duration).setRelative() might fail 
> unexpectedly
> -----------------------------------------------------------------------------------------
>
>                 Key: BEAM-12276
>                 URL: https://issues.apache.org/jira/browse/BEAM-12276
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>    Affects Versions: 2.30.0
>            Reporter: Jan Lukavský
>            Assignee: Jan Lukavský
>            Priority: P2
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> We check that timer's output timestamp is not before timer fire timestamp. 
> The fire timestamp is unknown to user when setting a relative timer and 
> therefore cannot be checked in user code.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to