Repository navigation
Conversation
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR effectively resolves transient GCS read timeouts during Java Dataflow job staging by bypassing StorageBatch.submit() for single-path lookups, falling back to individual retried getBlob() calls when batch.submit() fails with a retryable StorageException, and moving PackageUtil.alreadyStaged() inside the existing retry loop. The implementation is clean, consistent with GcsUtilV1 behavior, and well-covered by unit tests.
🔍 General Feedback
- Bypassing
StorageBatchwhenpathPartition.size() == 1inGcsUtilV2.getBlobs()nicely mirrorsGcsUtilV1.getObjects()and ensures single-file metadata lookups leverage the client's configuredStorageRetryStrategy. - Moving
alreadyStaged()inside thetry / catch (IOException)block inPackageUtil.tryStagePackageWithRetry()ensures transient errors during pre-upload existence checks are retried with backoff. - You may want to consider applying the same
batch.submit()StorageExceptionhandling and single-item bypass toGcsUtilV2.remove()in a follow-up, as it uses the sameStorageBatchpattern.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR resolves transient GCS read timeout failures during Dataflow package staging and GcsUtilV2.getBlobs lookups by bypassing unretried multipart StorageBatch.submit() calls for single-path partitions, falling back to retried individual getBlob() calls when batch.submit() fails with a retryable StorageException, and moving PackageUtil.alreadyStaged() inside the retry loop.
🔍 General Feedback
- The changes in
GcsUtilV2andPackageUtilare clean, well-scoped, and properly covered by unit tests. - As a follow-up consideration,
GcsUtilV2.remove()(around line 655) uses the sameStorageBatch.submit()pattern and could benefit from the same single-path bypass andStorageExceptionhandling onbatch.submit().
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41773 +/- ##
=========================================
Coverage 58.12% 58.12%
Complexity 2843 2843
=========================================
Files 1211 1211
Lines 173473 173473
Branches 2329 2329
=========================================
Hits 100824 100824
Misses 69940 69940
Partials 2709 2709 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Closing per updated test-health policy: |
|
Reopening under the updated per-issue >= 3 failures in 7 days rule: this StorageException staging failure occurred 3 times in the past 7 days (runs 45935052823, 46224436195, and 46573848386). |
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:
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
GcsUtilV2(including Cloud Dataflow job submission staging viaPackageUtilandFileSystems.matchSingleFileSpec).SocketTimeoutException: Read timed outinsideStorageBatch.submit()fails job submission immediately with an uncheckedStorageExceptioninstead of retrying.getBlobs()lookups bypass unretried multipart batch submission and usegetBlob()directly (which applies the GCS client's retry strategy), multi-pathbatch.submit()falls back to individualgetBlob()calls on retryableStorageExceptionand translates non-retryable errors viatranslateStorageException(), andPackageUtil.tryStagePackageWithRetry()executesalreadyStaged()inside its existingtry / catch (IOException)retry loop.Changes
GcsUtilV2.java: AddgetBlobResult()reusinggetBlob(), bypassStorageBatchwhenpathPartition.size() == 1, and wrapbatch.submit()to fall back on retryableStorageExceptionor translate non-retryableStorageExceptiontoIOException.PackageUtil.java: MovealreadyStaged(attributes)insidetryStagePackageWithRetry()'stry / catch (IOException)loop.GcsUtilV2Test.java&PackageUtilTest.java: Add unit tests covering single-path bypass, retryable/non-retryablebatch.submit()failures, and transientIOExceptionretries inalreadyStaged().Verification
beam_PostCommit_Java_DataflowV2.ymlworkflow run on branch:46451544121