Skip to content
This repository was archived by the owner on Jul 25, 2020. It is now read-only.

Commit 4ba1da5

Browse files
author
Adrian Cole
committed
scoped retryOnRenew binding to keystone as opposed to nova
1 parent f8ebb67 commit 4ba1da5

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

common/openstack/src/main/java/org/jclouds/openstack/keystone/v2_0/config/KeyStoneAuthenticationModule.java

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public class KeyStoneAuthenticationModule extends AbstractModule {
6565
protected void configure() {
6666
bind(new TypeLiteral<Function<Credentials, Access>>() {
6767
}).to(GetAccess.class);
68+
bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(RetryOnRenew.class);
6869
}
6970

7071
/**

common/openstack/src/main/java/org/jclouds/openstack/keystone/v2_0/handlers/RetryOnRenew.java

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) {
6767
retry = false;
6868
} else {
6969
byte[] content = closeClientButKeepContentStream(response);
70+
//TODO: what is the error when the session token expires??
7071
if (content != null && new String(content).contains("lease renew")) {
7172
logger.debug("invalidating authentication token");
7273
authenticationResponseCache.invalidateAll();

labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/config/NovaRestClientModule.java

-7
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424
import javax.inject.Singleton;
2525

2626
import org.jclouds.http.HttpErrorHandler;
27-
import org.jclouds.http.HttpRetryHandler;
2827
import org.jclouds.http.RequiresHttp;
2928
import org.jclouds.http.annotation.ClientError;
3029
import org.jclouds.http.annotation.Redirection;
3130
import org.jclouds.http.annotation.ServerError;
32-
import org.jclouds.http.handlers.BackoffLimitedRetryHandler;
3331
import org.jclouds.openstack.keystone.v2_0.config.KeyStoneAuthenticationModule;
3432
import org.jclouds.openstack.keystone.v2_0.domain.Access;
3533
import org.jclouds.openstack.keystone.v2_0.domain.Service;
@@ -86,11 +84,6 @@ protected void bindErrorHandlers() {
8684
bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(NovaErrorHandler.class);
8785
}
8886

89-
@Override
90-
protected void bindRetryHandlers() {
91-
bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(BackoffLimitedRetryHandler.class);
92-
}
93-
9487
@Provides
9588
@Singleton
9689
@Compute

0 commit comments

Comments
 (0)