You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "stankiewicz (via GitHub)" <gi...@apache.org> on 2025/12/05 17:17:23 UTC

[PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

stankiewicz opened a new pull request, #37012:
URL: https://github.com/apache/beam/pull/37012

   Stacked on top of https://github.com/apache/beam/pull/37009
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
    - [ ] Update `CHANGES.md` with noteworthy changes.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
   
   To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
   
   GitHub Actions Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   [![Build python source distribution and wheels](https://github.com/apache/beam/actions/workflows/build_wheels.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python tests](https://github.com/apache/beam/actions/workflows/python_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/actions/workflows/java_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Go tests](https://github.com/apache/beam/actions/workflows/go_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
   
   See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
   


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "stankiewicz (via GitHub)" <gi...@apache.org>.
stankiewicz commented on code in PR #37012:
URL: https://github.com/apache/beam/pull/37012#discussion_r2816989604


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java:
##########


Review Comment:
   @kennknowles here, windowedValue is sent differently, why is that?



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "stankiewicz (via GitHub)" <gi...@apache.org>.
stankiewicz commented on code in PR #37012:
URL: https://github.com/apache/beam/pull/37012#discussion_r2769235991


##########
runners/core-java/src/test/java/org/apache/beam/runners/core/SimpleDoFnRunnerTest.java:
##########
@@ -702,7 +707,9 @@ public void onTimer(OnTimerContext context) {
               context.fireTimestamp(),
               context.timestamp(),
               context.timeDomain(),
-              TimerData.CausedByDrain.NORMAL));
+              context.causedByDrain()
+                  ? TimerData.CausedByDrain.CAUSED_BY_DRAIN
+                  : TimerData.CausedByDrain.NORMAL));

Review Comment:
   see here @kennknowles , I don't want to do that everywhere, I should just pass it through. 



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37012:
URL: https://github.com/apache/beam/pull/37012#issuecomment-3847254573

   This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@beam.apache.org list. Thank you for your contributions.


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "stankiewicz (via GitHub)" <gi...@apache.org>.
stankiewicz commented on PR #37012:
URL: https://github.com/apache/beam/pull/37012#issuecomment-3619798768

   Run Java PreCommit


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "stankiewicz (via GitHub)" <gi...@apache.org>.
stankiewicz commented on code in PR #37012:
URL: https://github.com/apache/beam/pull/37012#discussion_r2817009413


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFn.java:
##########


Review Comment:
   @kennknowles , I assume that by introducing builder we freeze outputWindowedValue and have some limited functionality, but as part of receiver we should use outputWindowedValue method as we risk losing any new fields we've added. 



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "stankiewicz (via GitHub)" <gi...@apache.org>.
stankiewicz commented on PR #37012:
URL: https://github.com/apache/beam/pull/37012#issuecomment-3617790091

   For stack delta, you look at relevant commit - ontimer


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "stankiewicz (via GitHub)" <gi...@apache.org>.
stankiewicz commented on code in PR #37012:
URL: https://github.com/apache/beam/pull/37012#discussion_r2816978510


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java:
##########
@@ -2772,6 +2798,7 @@ public OutputBuilder<Row> builder(Row value) {
                     .setTimestamp(currentTimer.getHoldTimestamp())
                     .setWindow(currentWindow)
                     .setPaneInfo(currentTimer.getPaneInfo())
+                    .setCausedByDrain(causedByDrain)
                     .setReceiver(
                         windowedValue ->

Review Comment:
   @kennknowles , ptal.
   
   causedBy drain will be part of windowedValue but because receiver is lambda from WV to context.outputWindowedValue, I'm pretty sure I'm loosing all WV metadata. 
   
   



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37012:
URL: https://github.com/apache/beam/pull/37012#issuecomment-3619051093

   Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment `assign set of reviewers`


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "kennknowles (via GitHub)" <gi...@apache.org>.
kennknowles commented on code in PR #37012:
URL: https://github.com/apache/beam/pull/37012#discussion_r2769816955


##########
runners/core-java/src/main/java/org/apache/beam/runners/core/DoFnRunner.java:
##########
@@ -46,7 +46,8 @@ public interface DoFnRunner<InputT extends @Nullable Object, OutputT extends @Nu
       BoundedWindow window,
       Instant timestamp,
       Instant outputTimestamp,
-      TimeDomain timeDomain);
+      TimeDomain timeDomain,
+      boolean causedByDrain);

Review Comment:
   Yes, enum is much clearer. Maybe an IDE can do it for you (even without AI :-)



##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java:
##########
@@ -1929,6 +1938,11 @@ public <T> void outputWindowedValue(
       }
       outputTo(consumer, WindowedValues.of(output, timestamp, windows, paneInfo));
     }
+
+    @Override
+    public boolean causedByDrain() {
+      return currentElement.causedByDrain();

Review Comment:
   Yes!



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "kennknowles (via GitHub)" <gi...@apache.org>.
kennknowles commented on PR #37012:
URL: https://github.com/apache/beam/pull/37012#issuecomment-3960666007

   waiting on author


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "stankiewicz (via GitHub)" <gi...@apache.org>.
stankiewicz commented on code in PR #37012:
URL: https://github.com/apache/beam/pull/37012#discussion_r2769244093


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java:
##########
@@ -1929,6 +1938,11 @@ public <T> void outputWindowedValue(
       }
       outputTo(consumer, WindowedValues.of(output, timestamp, windows, paneInfo));
     }
+
+    @Override
+    public boolean causedByDrain() {
+      return currentElement.causedByDrain();

Review Comment:
   should enum be used here as well? @kennknowles 



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "stankiewicz (via GitHub)" <gi...@apache.org>.
stankiewicz commented on code in PR #37012:
URL: https://github.com/apache/beam/pull/37012#discussion_r2769232865


##########
runners/core-java/src/main/java/org/apache/beam/runners/core/DoFnRunner.java:
##########
@@ -46,7 +46,8 @@ public interface DoFnRunner<InputT extends @Nullable Object, OutputT extends @Nu
       BoundedWindow window,
       Instant timestamp,
       Instant outputTimestamp,
-      TimeDomain timeDomain);
+      TimeDomain timeDomain,
+      boolean causedByDrain);

Review Comment:
   @kennknowles I'm curious your opinion. In timerdata I've introduced enum CausedByDrain, should I move everywhere to enum then? it's not a lot of rework, it's just many files modified



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37012:
URL: https://github.com/apache/beam/pull/37012#issuecomment-3958932682

   Reminder, please take a look at this pr: @chamikaramj 


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "kennknowles (via GitHub)" <gi...@apache.org>.
kennknowles commented on code in PR #37012:
URL: https://github.com/apache/beam/pull/37012#discussion_r2818760785


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java:
##########


Review Comment:
   I am not sure. This file was a huge mess, with actually many types of transforms executed in the same file via switch statements. It may just be an accidental piece of history and/or a part that I failed to refactor when I introduced OutputBuilder. My quick read is that this one is the idea way to do it, because it passes the whole WindowedValue to the FnDataReceiver so it doesn't lose dasta. In the other places where it goes through the OnTimerContext it loses metadata.



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37012:
URL: https://github.com/apache/beam/pull/37012#issuecomment-3915711659

   Assigning reviewers:
   
   R: @chamikaramj for label java.
   
   
   Note: If you would like to opt out of this review, comment `assign to next reviewer`.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
   
   The PR bot will only process comments in the main thread (not review comments).


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "kennknowles (via GitHub)" <gi...@apache.org>.
kennknowles commented on code in PR #37012:
URL: https://github.com/apache/beam/pull/37012#discussion_r2818360514


##########
runners/java-fn-execution/src/test/java/org/apache/beam/runners/fnexecution/wire/CommonCoderTest.java:
##########
@@ -326,7 +327,8 @@ private static Object convertValue(Object value, CommonCoder coderSpec, Coder co
           windows,
           new Instant(((Number) kvMap.get("fireTimestamp")).longValue()),
           new Instant(((Number) kvMap.get("holdTimestamp")).longValue()),
-          paneInfo);
+          paneInfo,
+          CausedByDrain.NORMAL);

Review Comment:
   I think this should actually come from the data? It is a weird method and I have no context for why it is the way it is...



##########
runners/core-java/src/main/java/org/apache/beam/runners/core/OutputAndTimeBoundedSplittableProcessElementInvoker.java:
##########
@@ -396,6 +397,11 @@ public PaneInfo pane() {
       return element.getRecordOffset();
     }
 
+    @Override
+    public CausedByDrain causedByDrain() {
+      return CausedByDrain.NORMAL;

Review Comment:
   Should this come from the element metadata?



##########
runners/core-java/src/test/java/org/apache/beam/runners/core/SimpleDoFnRunnerTest.java:
##########
@@ -141,7 +141,8 @@ public void testOnTimerExceptionsWrappedAsUserCodeException() {
         GlobalWindow.INSTANCE,
         new Instant(0),
         new Instant(0),
-        TimeDomain.EVENT_TIME);
+        TimeDomain.EVENT_TIME,
+        CausedByDrain.NORMAL);

Review Comment:
   Maybe this unit test file should test caused by drain propagation somehow?



##########
runners/core-java/src/main/java/org/apache/beam/runners/core/OutputAndTimeBoundedSplittableProcessElementInvoker.java:
##########
@@ -396,6 +397,11 @@ public PaneInfo pane() {
       return element.getRecordOffset();
     }
 
+    @Override
+    public CausedByDrain causedByDrain() {
+      return CausedByDrain.NORMAL;

Review Comment:
   Should this come from the element metadata?



##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFn.java:
##########


Review Comment:
   I am not sure if I understand the comment. Here is what I think are answers:
   
    - Yes, we freeze the API for `outputWindowedValue`.
    - No, we shouldn't lose fields, because `builder(value)` is an abstract method and it is the job of `OutputReceiver.builder(...)` to make sure to set all the builder values to defaults, and propagate the values from the current element or timer context.



##########
runners/core-java/src/main/java/org/apache/beam/runners/core/SimplePushbackSideInputDoFnRunner.java:
##########
@@ -116,7 +117,15 @@ public <KeyT> void onTimer(
       Instant timestamp,
       Instant outputTimestamp,
       TimeDomain timeDomain) {
-    underlying.onTimer(timerId, timerFamilyId, key, window, timestamp, outputTimestamp, timeDomain);
+    underlying.onTimer(
+        timerId,
+        timerFamilyId,
+        key,
+        window,
+        timestamp,
+        outputTimestamp,
+        timeDomain,
+        CausedByDrain.NORMAL);

Review Comment:
   I think it should propagate here? will that be a follow-up that adds it to the pushback side input DoFnRunner?



##########
sdks/java/core/src/test/java/org/apache/beam/sdk/util/construction/TimerTest.java:
##########
@@ -126,14 +132,16 @@ public void testTimerCoderWithConsistentWithEqualsComponentCoders() throws Excep
             Collections.singletonList(GlobalWindow.INSTANCE),
             FIRE_TIME,
             HOLD_TIME,
-            PaneInfo.NO_FIRING),
+            PaneInfo.NO_FIRING,
+            CausedByDrain.NORMAL),
         Timer.of(
             "key",
             "tag",
             Collections.singletonList(GlobalWindow.INSTANCE),
             FIRE_TIME,
             HOLD_TIME,
-            PaneInfo.NO_FIRING));
+            PaneInfo.NO_FIRING,
+            CausedByDrain.NORMAL));

Review Comment:
   We need some caused by drain tests?



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #37012:
URL: https://github.com/apache/beam/pull/37012#issuecomment-3853482600

   ## [Codecov](https://app.codecov.io/gh/apache/beam/pull/37012?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 40.06%. Comparing base ([`4e76198`](https://app.codecov.io/gh/apache/beam/commit/4e76198555e76672c2be3439b9152d483351e7f5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2612296`](https://app.codecov.io/gh/apache/beam/commit/261229670f5c89ade5b68ac9577584a5e0c6901d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff            @@
   ##             master   #37012   +/-   ##
   =========================================
     Coverage     40.06%   40.06%           
     Complexity     3404     3404           
   =========================================
     Files          1177     1177           
     Lines        187083   187083           
     Branches       3581     3581           
   =========================================
   + Hits          74947    74953    +6     
   + Misses       108744   108739    -5     
   + Partials       3392     3391    -1     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/beam/pull/37012/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [java](https://app.codecov.io/gh/apache/beam/pull/37012/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `71.93% <ø> (+0.02%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/beam/pull/37012?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Drain] OnTimer - propagate caused by drain bit up to DoFnRunner [beam]

Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on PR #37012:
URL: https://github.com/apache/beam/pull/37012#issuecomment-3617790965

   ## Summary of Changes
   
   Hello @stankiewicz, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
   
   This pull request enhances the Apache Beam Java SDK's timer mechanism by introducing a `causedByDrain` flag. This flag allows `DoFn`s to distinguish between timers that fire as part of normal pipeline execution and those that are explicitly triggered during a pipeline draining process. By propagating this information through the core timer interfaces and their implementations, it provides more granular control and context for `DoFn`s reacting to timer events, which is crucial for robust pipeline shutdown and data consistency during draining.
   
   ### Highlights
   
   * **Propagate 'causedByDrain' Flag**: Introduced a `boolean causedByDrain` parameter to the `DoFnRunner.onTimer` method and `TimerInternals.TimerData` to indicate if a timer firing was triggered by a draining operation.
   * **DoFn Context Updates**: Added `causedByDrain()` abstract methods to `DoFn.ProcessContext` and `DoFn.OnTimerContext` to expose the drain status to user `DoFn` logic.
   * **Extensive Integration**: Updated numerous `DoFnRunner` implementations, `TimerData` factory methods, and `Timer` utility classes across various runners (Core Java, Flink, Dataflow, Samza, Spark) and SDK components to correctly pass and handle the new `causedByDrain` flag.
   * **Test Coverage**: Modified existing test cases to accommodate the new `causedByDrain` parameter in `TimerData.of` and `Timer.of` calls, ensuring consistency and correctness.
   
   
   
   
   
   
   
   <details>
   <summary><b>Using Gemini Code Assist</b></summary>
   <br>
   
   The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips.
   
   <b>Invoking Gemini</b>
   
   You can request assistance from Gemini at any point by creating a comment using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands on the current page.
   
   Feature | Command | Description
   --- | --- | ---
   Code Review | `/gemini review` | Performs a code review for the current pull request in its current state.
   Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state.
   Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments.
   Help | `/gemini help` | Displays a list of available commands.
   
   <b>Customization</b>
   
   To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github).
   
   <b>Limitations & Feedback</b>
   
   Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG).
   
   <b>You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the [Gemini Code Assist IDE Extension](https://cloud.google.com/products/gemini/code-assist).</b>
   </details>
   
   
   
   
   [^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).
   


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org