Skip to content

Commit dbac8c9

Browse files
committed
Fix ice-rest-catalog retrying 403s
1 parent 9e9a388 commit dbac8c9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ice-rest-catalog/src/main/java/org/apache/iceberg/BaseMetastoreTableOperations.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.apache.iceberg.util.Tasks;
3838
import org.slf4j.Logger;
3939
import org.slf4j.LoggerFactory;
40+
import software.amazon.awssdk.core.exception.SdkServiceException;
4041

4142
public abstract class BaseMetastoreTableOperations extends BaseMetastoreOperations
4243
implements TableOperations {
@@ -188,6 +189,13 @@ protected void refreshFromMetadataLocation(
188189
if (!Objects.equal(currentMetadataLocation, newLocation)) {
189190
LOG.info("Refreshing table metadata from new version: {}", newLocation);
190191

192+
if (shouldRetry == null) {
193+
shouldRetry =
194+
e ->
195+
e instanceof SdkServiceException
196+
&& ((SdkServiceException) e).isRetryableException();
197+
}
198+
191199
AtomicReference<TableMetadata> newMetadata = new AtomicReference<>();
192200
Tasks.foreach(newLocation)
193201
.retry(numRetries)

0 commit comments

Comments
 (0)