damccorm opened a new pull request, #41773:
URL: https://github.com/apache/beam/pull/41773
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
Fixes unretried transient GCS read timeouts during Java Dataflow job staging
that caused 3 failures across 3 workflows in 7 days (runs
https://github.com/apache/beam/actions/runs/45936241381,
https://github.com/apache/beam/actions/runs/45935052823, and
https://github.com/apache/beam/actions/runs/46224436195).
## Production Impact
- **Affected workloads**: Java pipelines using `GcsUtilV2` (including Cloud
Dataflow job submission staging via `PackageUtil` and
`FileSystems.matchSingleFileSpec`).
- **Symptom**: A single transient `SocketTimeoutException: Read timed out`
inside `StorageBatch.submit()` fails job submission immediately with an
unchecked `StorageException` instead of retrying.
- **Resolution**: Single-path `getBlobs()` lookups bypass unretried
multipart batch submission and use `getBlob()` directly (which applies the GCS
client's retry strategy), multi-path `batch.submit()` falls back to individual
`getBlob()` calls on retryable `StorageException` and translates non-retryable
errors via `translateStorageException()`, and
`PackageUtil.tryStagePackageWithRetry()` executes `alreadyStaged()` inside its
existing `try / catch (IOException)` retry loop.
## Changes
- `GcsUtilV2.java`: Add `getBlobResult()` reusing `getBlob()`, bypass
`StorageBatch` when `pathPartition.size() == 1`, and wrap `batch.submit()` to
fall back on retryable `StorageException` or translate non-retryable
`StorageException` to `IOException`.
- `PackageUtil.java`: Move `alreadyStaged(attributes)` inside
`tryStagePackageWithRetry()`'s `try / catch (IOException)` loop.
- `GcsUtilV2Test.java` & `PackageUtilTest.java`: Add unit tests covering
single-path bypass, retryable/non-retryable `batch.submit()` failures, and
transient `IOException` retries in `alreadyStaged()`.
### Verification
- Triggered `beam_PostCommit_Java_DataflowV2.yml` workflow run on branch:
[`46451544121`](https://github.com/apache/beam/actions/runs/46451544121)
--
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]