Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

[Conjure Java Runtime] Part 19: Retrying is Futile... Sometimes. #4370

Merged
merged 6 commits into from
Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public <T> InstanceAndVersion<T> createProxy(
addAtlasDbRemotingAgent(parameters.userAgent()),
HOST_METRICS_REGISTRY,
clientConfiguration);
client = FastFailoverProxy.newProxyInstance(type, client);
return wrapWithVersion(client);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private static <T> T createClientToMultipleNodes(Class<T> clazz, List<String> no
.sslConfiguration(SSL_CONFIGURATION)
.build(),
clazz,
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS);
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS_RETRYING);
}

private static <T> T createClientFor(Class<T> clazz, String host, short port) {
Expand All @@ -208,6 +208,6 @@ private static <T> T createClientFor(Class<T> clazz, String host, short port) {
Optional.of(TRUST_CONTEXT),
uri,
clazz,
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS);
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS_RETRYING);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private static <T> T createEteClientFor(Class<T> clazz) {
Optional.empty(),
uri,
clazz,
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS);
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS_RETRYING);
}

private static TimestampService createTimeLockTimestampClient() {
Expand All @@ -197,6 +197,6 @@ private static TimestampService createTimeLockTimestampClient() {
Optional.empty(),
uri,
TimestampService.class,
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS);
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS_RETRYING);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class TestProxyUtils {
.maximumConjureRemotingProbability(1.0)
.build();

public static final AuxiliaryRemotingParameters AUXILIARY_REMOTING_PARAMETERS
public static final AuxiliaryRemotingParameters AUXILIARY_REMOTING_PARAMETERS_RETRYING
= AuxiliaryRemotingParameters.builder()
.shouldLimitPayload(false)
.userAgent(UserAgent.of(UserAgent.Agent.of("bla", "0.1.2")))
Expand Down
10 changes: 10 additions & 0 deletions changelog/@unreleased/pr-4370.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: fix
fix:
description: We no longer create a `FastFailoverProxy` when creating a single node
proxy. Previously, if this was created when talking to an individual TimeLock
node that was not the leader (or a service that would otherwise return `308`s),
we would spin for about 10 seconds before returning. Users of failover proxies
to TimeLock (e.g. if using the timestamp or lock services from a `TransactionManager`)
are unaffected.
links:
- https://github.com/palantir/atlasdb/pull/4370
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private static <T> T createProxyForInternalNamespacedTestService(Class<T> clazz)
PaxosTimeLockConstants.CLIENT_PAXOS_NAMESPACE,
CLIENT),
clazz,
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS);
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS_RETRYING);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static void waitForClusterToStabilize() {
Optional.of(TestProxies.TRUST_CONTEXT),
"https://localhost:" + TIMELOCK_SERVER_HOLDER.getTimelockPort(),
PingableLeader.class,
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS);
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS_RETRYING);
Awaitility.await()
.atMost(30, TimeUnit.SECONDS)
.pollInterval(1, TimeUnit.SECONDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public <T> T singleNode(Class<T> serviceInterface, String uri) {
Optional.of(TRUST_CONTEXT),
uri,
serviceInterface,
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS));
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS_RETRYING));
}

public <T> T failoverForClient(String client, Class<T> serviceInterface) {
Expand All @@ -79,7 +79,7 @@ public <T> T failover(Class<T> serviceInterface, List<String> uris) {
new MetricRegistry(),
ImmutableServerListConfig.builder().addAllServers(uris).sslConfiguration(SSL_CONFIGURATION).build(),
serviceInterface,
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS));
TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS_RETRYING));
}

public List<String> getServerUris() {
Expand Down