Core: Make REST scan planning poll retries configurable - #17846
Open
Bartekszost wants to merge 1 commit into
Open
Core: Make REST scan planning poll retries configurable#17846Bartekszost wants to merge 1 commit into
Bartekszost wants to merge 1 commit into
Conversation
Allow catalogs to set rest-scan-planning.poll-num-retries so long-running remote plans are not stopped by the default retry count. Generated-by: Cursor
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a new REST catalog property to make async REST scan planning poll retry count configurable, replacing a previously hardcoded retry limit and expanding tests around async planning behavior.
Changes:
- Introduce
rest-scan-planning.poll-num-retries(default 10) and validate it is non-negative. - Use the configured retry value in
RESTTableScanpolling and include it in timeout diagnostics. - Add unit tests covering configured retry behavior, success path, and invalid configuration.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| core/src/main/java/org/apache/iceberg/rest/RESTCatalogProperties.java | Adds new catalog property constants for configurable poll retry count. |
| core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java | Reads/validates the new property, uses it in the poll loop, and improves timeout messaging. |
| core/src/test/java/org/apache/iceberg/rest/TestRESTScanPlanning.java | Adds tests for honoring retry config, custom retries, and rejecting invalid values. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1375
to
+1387
| catalogWithAdapter.catalog.initialize( | ||
| "test-custom-retries", | ||
| ImmutableMap.of( | ||
| CatalogProperties.FILE_IO_IMPL, | ||
| "org.apache.iceberg.inmemory.InMemoryFileIO", | ||
| RESTCatalogProperties.SCAN_PLANNING_MODE, | ||
| RESTCatalogProperties.ScanPlanningMode.SERVER.modeName(), | ||
| RESTCatalogProperties.REST_SCAN_PLANNING_POLL_NUM_RETRIES, | ||
| "10")); | ||
|
|
||
| RESTTable table = restTableFor(catalogWithAdapter.catalog, "custom_retries_success"); | ||
| setParserContext(table); | ||
| assertThat(table.newScan().planFiles()).hasSize(1); |
| // With 0 retries and a server that never completes, planFiles should fail after one attempt | ||
| assertThatThrownBy(scan::planFiles) | ||
| .isInstanceOf(RemotePlanTimeoutException.class) | ||
| .hasMessageContaining("did not complete within configured limits"); |
| @@ -58,6 +58,10 @@ private RESTCatalogProperties() {} | |||
| public static final long REST_SCAN_PLANNING_POLL_TIMEOUT_MS_DEFAULT = | |||
| TimeUnit.MINUTES.toMillis(5); | |||
|
|
|||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rest-scan-planning.poll-num-retriescatalog property that controls the maximum number of poll attempts when waiting for async scan planning results inRESTTableScan(default remains 10)rest-scan-planning.poll-timeout-msproperty from Core : Make REST scan planning poll timeout configurable #15863: the timeout bounds the total wait time, while this property bounds the number of poll retries. Together they let deployments that support longer-running server-side scan plans raise both limits so large plans are not cut off prematurely by a fixed retry countMAX_RETRIESconstant inRESTTableScanwith the configured value, and validate that the configured value is non-negativeRemotePlanTimeoutExceptionmessage so the failure is easier to diagnoseTest plan
asyncPlanningRespectsConfigurablePollRetries: sets a lowpoll-num-retriesagainst a server that never completes and verifies the poll loop stops after exactly the configured number of retriesasyncPlanningSucceedsWithCustomRetries: sets an explicitpoll-num-retriesand verifies async planning completes successfullyasyncPlanningRejectsInvalidRetries: verifies negativepoll-num-retriesvalues are rejected withIllegalArgumentExceptionAI Disclosure