You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "Eliaaazzz (via GitHub)" <gi...@apache.org> on 2026/08/22 13:24:08 UTC

[PR] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   Fixes #39848.
   
   ### The bug
   
   `PersistBundle` decoded the SDK's requested resume delay into `engine.Residual.Delay` and then returned every residual to the pending queue immediately, at the TODO "actually reschedule based on the residuals delay". A polling SDF therefore busy-spins: on a master build of Prism, a Python `Watch` poll loop requesting 3 second pacing via `defer_remainder` executed 7,034 poll rounds in 9 seconds of wall time.
   
   ### The change
   
   `PersistBundle` partitions residuals by delay. A residual with no delay returns to pending as before. A delayed residual is parked on its stage in `stageState.delayedResiduals`, keyed by the processing time it becomes schedulable, and that time is scheduled through the machinery processing-time timers already use: `ptRefreshes` → `em.processTimeEvents.Schedule` → `em.wakeUpAt`. The watermark evaluation loop releases due parked residuals back to pending before checking bundle readiness.
   
   Parked elements pin the stage's input watermark by being included in `minPendingTimestampLocked`, the same way pending elements do. An earlier revision used `watermarkHolds` instead; those clamp only the output watermark, and since the input watermark is monotonic, a bounded pipeline's global-window aggregation could fire early with partial data once the input watermark ran ahead during a park. The `TestSeparation` ProcessContinuations subtests catch exactly this and pass with the final design.
   
   Under the fast-forward clock (`EnableRTC=false`), `processingTimeNow` peeks the event queue, so delayed residuals still fire immediately in synthetic time and test pipelines stay fast. Under the default real-time clock the delay is honored; `--experiments=prism_disable_rtc` remains the opt-out. The ProcessContinuations subtests of `TestSeparation` now take real time (~15s instead of ~4s locally) because the 1 second resume delays they request are honored.
   
   ### Verification
   
   - New `TestPersistBundle_ResidualResumeDelay` engine tests: a delayed residual is parked rather than pending, pins `minPendingTimestampLocked`, and schedules a processing time event; under a real-time clock it fires only after the delay; under the fast-forward clock it fires without real waiting. Reverting the parking fails the first two subtests.
   - Full `runners/prism/...` Go tests pass.
   - End to end with the Python SDK against a rebuilt prism binary: the 3s-pacing probe went from 7,034 polls in 9 seconds to 4 polls at 3.01 second spacing; a `MatchContinuously` pipeline that previously missed files added mid-run on Prism now passes; `Watch` pipelines in both deduplication modes still pass.
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [x] 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.
    - [x] 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).
   


-- 
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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   Assigning reviewers:
   
   R: @shunping for label go.
   
   
   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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   We disabled a few java tests for Prism runner at https://github.com/apache/beam/blob/master/runners/prism/java/build.gradle. It would be great if you can enabled some of the SDF and timer related ones (for example GroupIntoBatches ones) to see if you fix here can also fix those tests. 
   
   This is not a blocker for this PR though.


-- 
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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   In fact I suspect all runners  have same issue, if checking the log of previous job: `2026-08-14_04_42_03-12041500729043885033`. Effectively busy polling is consistent throughout runners. We need to be more careful and understand the implementation of this fix, and if it indeeds align with spec.
   
   I think a proper fix should be done in SDK side, such that the watch transform should not initiate poll function and output when the time isn't advanced to next poll time:
   
   https://github.com/apache/beam/blob/466cf6d265bd4c833f8ba7377026708225b8458c/sdks/python/apache_beam/transforms/periodicsequence.py#L168


-- 
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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   Run GoPrism 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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn merged PR #39849:
URL: https://github.com/apache/beam/pull/39849


-- 
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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   Run Java_PVR_Prism_Loopback 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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   ## [Codecov](https://app.codecov.io/gh/apache/beam/pull/39849?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `91.22807%` with `5 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 59.69%. Comparing base ([`c101795`](https://app.codecov.io/gh/apache/beam/commit/c1017953ac3b213a951fe9534a33afcc1c1190ee?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`f85f0cb`](https://app.codecov.io/gh/apache/beam/commit/f85f0cb8e62e8343a1d8828cb6c22cec70fefea4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/beam/pull/39849?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...am/runners/prism/internal/engine/elementmanager.go](https://app.codecov.io/gh/apache/beam/pull/39849?src=pr&el=tree&filepath=sdks%2Fgo%2Fpkg%2Fbeam%2Frunners%2Fprism%2Finternal%2Fengine%2Felementmanager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9nby9wa2cvYmVhbS9ydW5uZXJzL3ByaXNtL2ludGVybmFsL2VuZ2luZS9lbGVtZW50bWFuYWdlci5nbw==) | 91.22% | [3 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/beam/pull/39849?src=pr&el=tree&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   #39849   +/-   ##
   =========================================
     Coverage     59.68%   59.69%           
     Complexity    16813    16813           
   =========================================
     Files          2863     2863           
     Lines        297877   297972   +95     
     Branches      14679    14679           
   =========================================
   + Hits         177793   177875   +82     
   - Misses       112473   112486   +13     
     Partials       7611     7611           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/beam/pull/39849/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [go](https://app.codecov.io/gh/apache/beam/pull/39849/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `29.09% <91.22%> (+0.06%)` | :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 Harness](https://app.codecov.io/gh/apache/beam/pull/39849?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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   Found the following tests in sickbay suite now passing:
   
   MetricsTest: testCommittedCounterMetrics, testCommittedDistributionMetrics, testCommittedGaugeMetrics, testCommittedStringSetMetrics (only boundedTrie not supported)
   
   GroupIntoBatchesTest: testInStreamingMode, testWithShardedKeyInGlobalWindow


-- 
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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   testInStreamingMode still failing
   ```
   2026-08-25T18:20:41.6121621Z GroupIntoBatchesTest > testInStreamingMode FAILED
   2026-08-25T18:20:41.6122801Z     java.lang.AssertionError at GroupIntoBatchesTest.java:438
   2026-08-25T18:20:41.6124060Z         Caused by: java.lang.RuntimeException at GroupIntoBatchesTest.java:438
   2026-08-25T18:20:41.6125802Z             Caused by: java.util.concurrent.ExecutionException at GroupIntoBatchesTest.java:438
   2026-08-25T18:20:41.6127271Z                 Caused by: java.lang.RuntimeException at JobServicePipelineResult.java:176
   ```


-- 
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] [Prism] Honor the resume delay of self-checkpointing SDF residuals [beam]

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

   Tested (1) PeriodicImpulse and (2) MatchContinuously, both pipeline eagerly runs process element prior to this change (as well as prior to #39572), and now the interval is honored.


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