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

   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
   
   Scopes Dataproc initialization action uploads in 
`.test-infra/dataproc/flink_cluster.sh` under 
`${GCS_BUCKET}/init-actions/${CLUSTER_NAME}/` (with teardown cleanup in 
`delete()`) and increases Flink's `resourcemanager.taskmanager-timeout` to 
`5min`.
   
   ## Root Cause
   
   1. **Shared unversioned init-action path race**: `flink_cluster.sh` uploaded 
`init-actions/beam.sh` to a single shared GCS path 
(`gs://beam-flink-cluster/init-actions/beam.sh`). When two Flink load test 
workflows ran concurrently (e.g., `LoadTests Go GBK Flink Batch` and `LoadTests 
Go ParDo Flink Batch`, both scheduled at 12:50 UTC), the second workflow's 
`gcloud storage cp` overwrote `beam.sh` on the unversioned bucket, deleting the 
object generation pinned by the first cluster's `gcloud dataproc clusters 
create` and failing worker bootstrap with `Script not found: 
gs://beam-flink-cluster/init-actions/beam.sh`.
   2. **Idle TaskManager teardown between sequential test steps**: 
`flink_cluster.sh` left Flink's `resourcemanager.taskmanager-timeout` at its 
30-second default. Multi-step Flink load tests run sequential Gradle/Go jobs on 
the same YARN Flink session cluster with ~30–60s gaps between steps; 
`FineGrainedSlotManager` can initiate YARN TaskExecutor shutdown right as the 
next step allocates slots, failing the step with `FlinkExpectedException: The 
TaskExecutor is shutting down`.
   
   ## Fix
   
   - Derive a per-cluster init-actions prefix 
`INIT_ACTIONS_GCS_DIR="${GCS_BUCKET%/}/${INIT_ACTIONS_FOLDER_NAME}/${CLUSTER_NAME}"`
 and point `BEAM_INIT` and `upload_init_actions` at it so concurrent clusters 
never overwrite each other's initialization scripts (including during `resize`).
   - Remove `${INIT_ACTIONS_GCS_DIR}` in `delete()` (best-effort `|| true`, 
preserving `gcloud dataproc clusters delete`'s exit code) so per-cluster init 
scripts do not accumulate in GCS.
   - Append `flink:resourcemanager.taskmanager-timeout=5min` to `FLINK_PROPS` 
so idle TaskManagers remain available across inter-step gaps.
   
   ## Verification
   
   - Verified syntax with `bash -n .test-infra/dataproc/flink_cluster.sh`.
   - Smoke-tested `upload_init_actions`, `create_cluster`, and `delete` (both 
success and failing cluster-delete exit-code preservation) with a mock `gcloud` 
binary.
   
   ### Recent Occurrences
   
   2 failing `master` workflow runs in the past 3 weeks:
   - `LoadTests Go GBK Flink Batch` (`Script not found: 
gs://beam-flink-cluster/init-actions/beam.sh`):
     - https://github.com/apache/beam/actions/runs/45024338207 (2026-11-22)
   - `LoadTests Go SideInput Flink Batch` (`FlinkExpectedException: The 
TaskExecutor is shutting down`):
     - https://github.com/apache/beam/actions/runs/45026406576 (2026-11-22)


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