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

   Note: this PR was auto-generated by tooling. Before moving it out of draft, 
the author has done a full review of the PR, specifically evaluating it on the 
following criteria:
   
   - The PR is an appropriate fix for the issue (e.g. we're not changing a test 
to avoid a bug)
   - The PR is a simple fix to the issue (e.g. we're not adding infra when we 
could just modify a test)
   - The PR is not covering for other problems (e.g. if we're bumping timeouts, 
it is not because we're covering for a performance problem)
     
   Full details of the methodology of generation and review can be found here - 
https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing
   
   If you have concerns with the PR or with the underlying methodology used to 
generate this, please comment below - they will be addressed by the author not 
the tooling :)
   
   ## Summary
   
   Passes `--executionModeForBatch=BATCH_FORCED` to the legacy Flink 1.20 
DataSet portable `ValidatesRunner` task (`validatesPortableRunnerBatchDataSet` 
in `runners/flink/job-server/flink_job_server.gradle`) to eliminate recurring 
1200s per-test hangs caused by Flink DataSet `ExecutionMode.PIPELINED` 
deadlocks on large single-region DAGs (`FLINK-10672`).
   
   ## Recent Occurrences (3 in past 7 days; 7+ in past 2 weeks)
   
   - **[47194886951](https://github.com/apache/beam/actions/runs/47194886951)** 
(`2026-12-03T20:20:28Z`, [scan](https://develocity.apache.org/s/3mfhadbsc53ey), 
JUnit artifact `15773066514`): 
`CombineTest$WindowingTests.testWindowedCombineGloballyAsSingletonView` timed 
out after 1200s (72 tasks scheduled into 1 single pipelined region; 24 tasks 
stuck including 3 upstream `Create.Values` `MapPartition` subtasks, while 
82-task sibling tests in the same class split across 3–5 pipelined regions 
finished in ~3s each).
   - **[47118926876](https://github.com/apache/beam/actions/runs/47118926876)** 
(`2026-12-03T13:44:43Z`, 
[scan](https://develocity.apache.org/s/6gqnyhby3gf6m)): 
`SplittableDoFnTest.testPairWithIndexWindowedTimestampedBounded` timed out 
after 1200s (80 tasks scheduled into 1 single pipelined region; 70 tasks stuck 
after all 10 `DataSource (Impulse)` tasks finished, while all 7 sibling tests 
with `<= 36` tasks per pipelined region finished in ~3s each).
   - **[46607208786](https://github.com/apache/beam/actions/runs/46607208786)** 
(`2026-12-01T08:28:10Z`, 
[scan](https://develocity.apache.org/s/4j2vqscopqrjc)): 
`ParDoTest$MultipleInputsAndOutputTests.testParDoEmptyWithTaggedOutput` timed 
out after 1200s with the identical stuck upstream `MapPartition` signature.
   - *(Previously observed in `44332123713`, `44542127211`, `44660084049`, and 
`45412377808`; run `47164382550` also hung >3.5h on Flink 1.20 DataSet while 
Flink 2.0/2.1/2.2 DataStream jobs all passed in ~18m.)*
   
   ## Root Cause
   
   - `validatesPortableRunnerBatchDataSet` runs the deprecated Flink 1.20 
DataSet API (removed in Flink 2.0) with Flink's default 
`ExecutionMode.PIPELINED` (`FlinkPipelineOptions.getExecutionModeForBatch()`), 
executing all operators of multi-`PAssert` / multi-branch test graphs 
simultaneously inside **1 single pipelined region** (72–80 concurrent tasks in 
a single embedded `MiniCluster` TaskManager).
   - This hits the known Flink DataSet pipelined execution deadlock 
(`FLINK-10672`), explicitly documented on 
`FlinkPipelineOptions.getExecutionModeForBatch()`: `"Set this to BATCH_FORCED 
if pipelines get blocked, see 
https://issues.apache.org/jira/browse/FLINK-10672."`
   - In contrast, `validatesPortableRunnerBatch` 
(`--useDataStreamForBatch=true`, used by Flink 2.0/2.1/2.2) runs with 
`RuntimeExecutionMode.BATCH` (blocking exchanges) and has zero occurrences of 
this deadlock.
   
   ## Fix
   
   - In `runners/flink/job-server/flink_job_server.gradle`, append 
`--executionModeForBatch=BATCH_FORCED` to `pipelineOptions` when `mode == 
"batch-dataset"`, forcing blocking data exchanges between stages so Flink 
breaks large DataSet test DAGs into sequential pipelined regions.
   
   ## Test Suite Runtime Impact
   
   - **Affected workflow/task:** `PostCommit Java PVR Flink Batch (1.20)` 
(`:runners:flink:1.20:job-server:validatesPortableRunnerBatchDataSet`, baseline 
~16.5m when passing cached on `master`).
   - **Expected impact:** Blocking stage boundaries add modest per-stage 
scheduling overhead across the 277 tiny local tests (exact measured wall time 
will be updated here once the triggered 
`beam_PostCommit_Java_PVR_Flink_Batch.yml` verification run completes), while 
eliminating 20-minute per-test timeouts and 4-hour workflow hangs.
   - **Unaffected:** Flink 2.0/2.1/2.2 `validatesPortableRunnerBatch` 
(DataStream), streaming PVR suites, and all other CI workflows (does not modify 
`buildSrc/`, so no global Gradle cache invalidation).
   
   Test/build-config-only change; no production SDK or Flink runner runtime 
code is modified.
   
   ### Verification
   - Triggered `beam_PostCommit_Java_PVR_Flink_Batch.yml` workflow run on 
branch: [`47209474000`](https://github.com/apache/beam/actions/runs/47209474000)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to