Skip to content

Core: Use Failsafe in ClientPoolImpl retry logic#10458

Closed
amogh-jahagirdar wants to merge 1 commit intoapache:mainfrom
amogh-jahagirdar:introduce-failsafe
Closed

Core: Use Failsafe in ClientPoolImpl retry logic#10458
amogh-jahagirdar wants to merge 1 commit intoapache:mainfrom
amogh-jahagirdar:introduce-failsafe

Conversation

@amogh-jahagirdar
Copy link
Contributor

This change is stemming from #10433 (comment).

This PR introduces Failsafe https://failsafe.dev/ as a dependency and integrates that into ClientPoolImpl where there is currently custom retry logic. The intent is to simplify the custom retry logic that currently exists by just using this dependency, which could also be used in other areas in the Iceberg codebase.

Comment on lines +74 to +87
AtomicReference<C> clientReference = new AtomicReference<>();
clientReference.set(get());

RetryPolicy<Object> retryPolicy =
RetryPolicy.builder()
.handle(reconnectExc)
.withMaxRetries(retry ? maxRetries : 0)
.withDelay(Duration.ofMillis(connectionRetryWaitPeriodMs))
.onRetry(
exc -> {
C currentClient = clientReference.get();
clientReference.set(reconnect(currentClient));
})
.build();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will also impact the JDBC catalog, since that uses ClientPoolImpl as well. CC @jbonofre if you were interested in taking a look at this, and would like your perspective on introducing Failsafe here.

@pvary
Copy link
Contributor

pvary commented Jun 10, 2024

@amogh-jahagirdar: Is there a way to avoid changing the type of the exception thrown?

@github-actions
Copy link

github-actions bot commented Nov 6, 2024

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 6, 2024
@github-actions
Copy link

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants