Repository navigation
Conversation
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR resolves transient ForbiddenException rate-limit failures during test teardown in BigQueryMetastoreCatalogIT by adding a retry mechanism with linear backoff in catalogCleanup. The implementation is clean, properly handles thread interrupts, and gives BigQuery's 10-second per-table metadata operation quota window sufficient time to reset.
🔍 General Feedback
- Because
super.catalogCleanup(namespaces)iterates overcatalog.listTables(namespace)and drops each table before dropping the namespace, retryingsuper.catalogCleanupis safe when adropTablecall hits a rate limit (already-dropped tables will no longer be returned bylistTableson subsequent attempts).
💡 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 #41235 +/- ##
============================================
- Coverage 59.27% 57.75% -1.52%
+ Complexity 4908 2617 -2291
============================================
Files 1461 1202 -259
Lines 186100 171679 -14421
Branches 3650 2163 -1487
============================================
- Hits 110311 99159 -11152
+ Misses 72440 69862 -2578
+ Partials 3349 2658 -691 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| @Override | ||
| public void catalogCleanup(List<Namespace> namespaces) throws IOException { |
There was a problem hiding this comment.
Instead of overriding, should we make this the default behavior in the superclass?
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR updates IcebergCatalogBaseIT.catalogCleanup to retry namespace and table teardown up to 3 times with linear backoff when encountering ForbiddenException (triggered by BigQuery Metastore rate limits). The change is clean, properly preserves interrupt status, and directly addresses the test flake.
🔍 General Feedback
- Moving the retry logic into the base
IcebergCatalogBaseITclass is a good approach that benefits all catalog implementations sharing this test harness. - Exception handling and backoff timing (
SETUP_TEARDOWN_SLEEP_MS * attempt) are well-structured and appropriate for test cleanup.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
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 flaky
IcebergIO Integration Testsfailures inBigQueryMetastoreCatalogIT.testReadWriteManagedPerOperationWithDefaultDrop(run 43154192604, run 42362603367):Root Cause
testReadWriteManagedPerOperationWithDefaultDropcreates and drops multiple tables in the BigQuery Metastore catalog, and then@After cleanUp()immediately callscatalogCleanup(namespaces)(listTables+dropTable+dropNamespace), which can exceed the per-secondapi_meta_requestsrate limit onBigQueryMetastoreCatalog.dropNamespaceand throworg.apache.iceberg.exceptions.ForbiddenException.Fix
Retry each namespace cleanup in
IcebergCatalogBaseIT.catalogCleanupup to 3 times with backoff (SETUP_TEARDOWN_SLEEP_MS * attempt) whenForbiddenExceptionis thrown.Verification
./gradlew :sdks:java:io:iceberg:spotlessCheck :sdks:java:io:iceberg:compileTestJava :sdks:java:io:iceberg:checkstyleTestIcebergIO Integration Tests(IO_Iceberg_Integration_Tests.yml) on branchfix/bqms-catalog-it-cleanup-ratelimit-retry(previous run 43166035024:success)