From a953328904e4f718778a04182f50db4f23d27276 Mon Sep 17 00:00:00 2001 From: Jeremy Kong Date: Fri, 10 Nov 2017 22:22:52 +0000 Subject: [PATCH] Live Reloading the TimeLock Block, Part 2: TransactionManagers Plumbing (#2622) * ServiceCreator.applyDynamic() * Propagate config through TMs * Json Serialization fixes * Some refactoring * lock/lock * Fixed checkstyle * CR comments part 1 * Switch to RPIH * add test * [no release notes] forthcoming in part 4 * checkstyle --- atlasdb-cli-distribution/versions.lock | 6 +- atlasdb-cli/versions.lock | 12 ++- .../atlasdb/config/AtlasDbRuntimeConfig.java | 10 +++ .../atlasdb/config/ServerListConfigs.java | 49 ++++++++++++ .../atlasdb/config/TimeLockClientConfig.java | 15 ++-- .../atlasdb/config/TimeLockRuntimeConfig.java | 29 +++++++ .../atlasdb/factory/ServiceCreator.java | 29 ++++--- .../atlasdb/factory/TransactionManagers.java | 50 +++++++----- .../factory/startup/TimeLockMigrator.java | 17 ++-- .../atlasdb/http/AtlasDbHttpClients.java | 43 +++++++++- ...asDbRuntimeConfigDeserializationTest.java} | 13 ++- .../atlasdb/config/ServerListConfigsTest.java | 80 +++++++++++++++++++ .../factory/TransactionManagersTest.java | 7 +- .../factory/startup/TimeLockMigratorTest.java | 18 +++-- .../atlasdb/http/AtlasDbHttpClientsTest.java | 34 ++++++++ .../test/resources/runtime-config-block.yml | 7 ++ atlasdb-config/versions.lock | 16 +++- atlasdb-console-distribution/versions.lock | 6 +- atlasdb-console/versions.lock | 12 ++- atlasdb-dagger/versions.lock | 12 ++- atlasdb-dbkvs-tests/versions.lock | 50 ++++++++++-- atlasdb-dropwizard-bundle/versions.lock | 8 +- atlasdb-ete-tests/versions.lock | 8 +- atlasdb-feign/build.gradle | 2 + .../atlasdb/config/ServerListConfig.java | 0 .../http/AtlasDbFeignTargetFactory.java | 49 ++++++++++++ atlasdb-feign/versions.lock | 52 +++++++++++- atlasdb-jepsen-tests/versions.lock | 12 ++- atlasdb-perf/versions.lock | 12 ++- atlasdb-service-server/versions.lock | 8 +- atlasdb-service/versions.lock | 12 ++- atlasdb-tests-shared/versions.lock | 50 ++++++++++-- timelock-agent/versions.lock | 12 ++- timelock-impl/versions.lock | 12 ++- timelock-server-distribution/versions.lock | 2 + timelock-server/versions.lock | 4 + 36 files changed, 628 insertions(+), 130 deletions(-) create mode 100644 atlasdb-config/src/main/java/com/palantir/atlasdb/config/ServerListConfigs.java create mode 100644 atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockRuntimeConfig.java rename atlasdb-config/src/test/java/com/palantir/atlasdb/config/{AtlasDbRuntimeConfigSerializationTest.java => AtlasDbRuntimeConfigDeserializationTest.java} (66%) create mode 100644 atlasdb-config/src/test/java/com/palantir/atlasdb/config/ServerListConfigsTest.java rename {atlasdb-config => atlasdb-feign}/src/main/java/com/palantir/atlasdb/config/ServerListConfig.java (100%) diff --git a/atlasdb-cli-distribution/versions.lock b/atlasdb-cli-distribution/versions.lock index 79576be86be..744fa29b876 100644 --- a/atlasdb-cli-distribution/versions.lock +++ b/atlasdb-cli-distribution/versions.lock @@ -561,7 +561,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -847,7 +848,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/atlasdb-cli/versions.lock b/atlasdb-cli/versions.lock index 6f06ed437a5..ed2e30591dc 100644 --- a/atlasdb-cli/versions.lock +++ b/atlasdb-cli/versions.lock @@ -485,7 +485,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -748,7 +749,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1374,7 +1376,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -1636,7 +1639,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/config/AtlasDbRuntimeConfig.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/config/AtlasDbRuntimeConfig.java index 5732795b2c8..792073986e8 100644 --- a/atlasdb-config/src/main/java/com/palantir/atlasdb/config/AtlasDbRuntimeConfig.java +++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/config/AtlasDbRuntimeConfig.java @@ -16,6 +16,8 @@ package com.palantir.atlasdb.config; +import java.util.Optional; + import org.immutables.value.Value; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -58,6 +60,14 @@ public long getTimestampCacheSize() { return AtlasDbConstants.DEFAULT_TIMESTAMP_CACHE_SIZE; } + /** + * Runtime live-reloadable parameters for communicating with TimeLock. + * + * This value is ignored if the install config does not specify usage of TimeLock. + * We do not currently support live reloading from a leader block or using embedded services to using TimeLock. + */ + public abstract Optional timelockRuntime(); + public static ImmutableAtlasDbRuntimeConfig defaultRuntimeConfig() { return ImmutableAtlasDbRuntimeConfig.builder().build(); } diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/config/ServerListConfigs.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/config/ServerListConfigs.java new file mode 100644 index 00000000000..5919504863d --- /dev/null +++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/config/ServerListConfigs.java @@ -0,0 +1,49 @@ +/* + * Copyright 2017 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the BSD-3 License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.atlasdb.config; + +import java.util.Optional; +import java.util.Set; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +public final class ServerListConfigs { + private ServerListConfigs() { + // utilities + } + + public static ServerListConfig parseInstallAndRuntimeConfigs(TimeLockClientConfig installClientConfig, + Supplier> runtimeConfig, + String namespace) { + ServerListConfig nonNamespacedConfig = runtimeConfig.get() + .map(TimeLockRuntimeConfig::serversList) + .orElse(installClientConfig.serversList()); + return namespaceUris(nonNamespacedConfig, namespace); + } + + public static ServerListConfig namespaceUris(ServerListConfig config, String namespace) { + Set serversWithNamespaces = config + .servers() + .stream() + .map(serverAddress -> serverAddress.replaceAll("/$", "") + "/" + namespace) + .collect(Collectors.toSet()); + return ImmutableServerListConfig.builder() + .from(config) + .servers(serversWithNamespaces) + .build(); + } +} diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockClientConfig.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockClientConfig.java index 73afab95986..f1934d44d43 100644 --- a/atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockClientConfig.java +++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockClientConfig.java @@ -16,8 +16,6 @@ package com.palantir.atlasdb.config; import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; import org.immutables.value.Value; @@ -45,16 +43,15 @@ public String getClientOrThrow() { "Tried to read a client from a TimeLockClientConfig, but it hadn't been initialised.")); } + /** + * @deprecated Please use {@link TimeLockRuntimeConfig} to specify the {@link ServerListConfig} to be used + * for connecting to TimeLock. + */ + @Deprecated public abstract ServerListConfig serversList(); public ServerListConfig toNamespacedServerList() { - Set serversWithNamespaces = serversList() - .servers() - .stream() - .map(serverAddress -> serverAddress.replaceAll("/$", "") + "/" + getClientOrThrow()) - .collect(Collectors.toSet()); - return ImmutableServerListConfig.copyOf(serversList()) - .withServers(serversWithNamespaces); + return ServerListConfigs.namespaceUris(serversList(), getClientOrThrow()); } @Value.Check diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockRuntimeConfig.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockRuntimeConfig.java new file mode 100644 index 00000000000..6335b5c3f93 --- /dev/null +++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockRuntimeConfig.java @@ -0,0 +1,29 @@ +/* + * Copyright 2017 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the BSD-3 License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.atlasdb.config; + +import org.immutables.value.Value; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +@JsonSerialize(as = ImmutableTimeLockRuntimeConfig.class) +@JsonDeserialize(as = ImmutableTimeLockRuntimeConfig.class) +@Value.Immutable +public abstract class TimeLockRuntimeConfig { + public abstract ServerListConfig serversList(); +} diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/ServiceCreator.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/ServiceCreator.java index 898f73db5e1..f50a912b881 100644 --- a/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/ServiceCreator.java +++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/ServiceCreator.java @@ -23,7 +23,7 @@ import java.net.URI; import java.util.List; import java.util.Optional; -import java.util.Set; +import java.util.function.Supplier; import javax.net.ssl.SSLSocketFactory; @@ -49,9 +49,18 @@ public ServiceCreator(Class serviceClass, String userAgent) { @Override public T apply(ServerListConfig input) { - Optional sslSocketFactory = createSslSocketFactory(input.sslConfiguration()); - Optional proxySelector = input.proxyConfiguration().map(ServiceCreator::createProxySelector); - return createService(sslSocketFactory, proxySelector, input.servers(), serviceClass, userAgent); + return applyDynamic(() -> input); + } + + // Semi-horrible, but given that we create ServiceCreators explicitly and I'd rather not API break our + // implementation of Function, leaving this here for now. + public T applyDynamic(Supplier input) { + return createService( + input, + SslSocketFactories::createSslSocketFactory, + ServiceCreator::createProxySelector, + serviceClass, + userAgent); } /** @@ -62,13 +71,13 @@ public static Optional createSslSocketFactory(Optional T createService( - Optional sslSocketFactory, - Optional proxySelector, - Set uris, - Class serviceClass, + Supplier serverListConfigSupplier, + java.util.function.Function sslSocketFactoryCreator, + java.util.function.Function proxySelectorCreator, + Class type, String userAgent) { - return AtlasDbHttpClients.createProxyWithFailover( - sslSocketFactory, proxySelector, uris, serviceClass, userAgent); + return AtlasDbHttpClients.createLiveReloadingProxyWithFailover( + serverListConfigSupplier, sslSocketFactoryCreator, proxySelectorCreator, type, userAgent); } public static T createInstrumentedService(T service, Class serviceClass) { diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/TransactionManagers.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/TransactionManagers.java index c51db40aed2..547fa5cf5b1 100644 --- a/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/TransactionManagers.java +++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/TransactionManagers.java @@ -45,12 +45,13 @@ import com.palantir.atlasdb.config.AtlasDbConfig; import com.palantir.atlasdb.config.AtlasDbRuntimeConfig; import com.palantir.atlasdb.config.ImmutableAtlasDbConfig; +import com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig; import com.palantir.atlasdb.config.ImmutableServerListConfig; import com.palantir.atlasdb.config.LeaderConfig; import com.palantir.atlasdb.config.ServerListConfig; +import com.palantir.atlasdb.config.ServerListConfigs; import com.palantir.atlasdb.config.SweepConfig; import com.palantir.atlasdb.config.TimeLockClientConfig; -import com.palantir.atlasdb.config.TimeLockClientConfigs; import com.palantir.atlasdb.config.TimestampClientConfig; import com.palantir.atlasdb.factory.Leaders.LocalPaxosServices; import com.palantir.atlasdb.factory.startup.TimeLockMigrator; @@ -313,7 +314,7 @@ SerializableTransactionManager serializable() { SimpleTimeDuration.of(config.getDefaultLockTimeoutSeconds(), TimeUnit.SECONDS)); LockAndTimestampServices lockAndTimestampServices = createLockAndTimestampServices( config, - () -> runtimeConfigSupplier.get().timestampClient(), + runtimeConfigSupplier, registrar(), () -> LockServiceImpl.create(lockServerOptions()), atlasFactory::getTimestampService, @@ -521,6 +522,7 @@ public static LockAndTimestampServices createLockAndTimestampServices( com.google.common.base.Supplier time) { LockAndTimestampServices lockAndTimestampServices = createRawInstrumentedServices(config, + () -> ImmutableAtlasDbRuntimeConfig.builder().build(), env, lock, time, @@ -535,16 +537,16 @@ public static LockAndTimestampServices createLockAndTimestampServices( @VisibleForTesting static LockAndTimestampServices createLockAndTimestampServices( AtlasDbConfig config, - java.util.function.Supplier runtimeConfigSupplier, + java.util.function.Supplier runtimeConfigSupplier, Consumer env, com.google.common.base.Supplier lock, com.google.common.base.Supplier time, TimestampStoreInvalidator invalidator, String userAgent) { LockAndTimestampServices lockAndTimestampServices = - createRawInstrumentedServices(config, env, lock, time, invalidator, userAgent); + createRawInstrumentedServices(config, runtimeConfigSupplier, env, lock, time, invalidator, userAgent); return withRequestBatchingTimestampService( - runtimeConfigSupplier, + () -> runtimeConfigSupplier.get().timestampClient(), withRefreshingLockService(lockAndTimestampServices)); } @@ -575,6 +577,7 @@ private static LockAndTimestampServices withRequestBatchingTimestampService( @VisibleForTesting static LockAndTimestampServices createRawInstrumentedServices( AtlasDbConfig config, + Supplier runtimeConfigSupplier, Consumer env, com.google.common.base.Supplier lock, com.google.common.base.Supplier time, @@ -585,7 +588,7 @@ static LockAndTimestampServices createRawInstrumentedServices( } else if (config.timestamp().isPresent() && config.lock().isPresent()) { return createRawRemoteServices(config, userAgent); } else if (config.timelock().isPresent()) { - return createRawServicesFromTimeLock(config, invalidator, userAgent); + return createRawServicesFromTimeLock(config, runtimeConfigSupplier, invalidator, userAgent); } else { return createRawEmbeddedServices(env, lock, time); } @@ -593,36 +596,39 @@ static LockAndTimestampServices createRawInstrumentedServices( private static LockAndTimestampServices createRawServicesFromTimeLock( AtlasDbConfig config, + Supplier runtimeConfigSupplier, TimestampStoreInvalidator invalidator, String userAgent) { - Preconditions.checkState(config.timelock().isPresent(), - "Cannot create raw services from timelock without a timelock block!"); - TimeLockClientConfig clientConfig = config.timelock().get(); - String resolvedClient = OptionalResolver.resolve(clientConfig.client(), config.namespace()); - TimeLockClientConfig timeLockClientConfig = - TimeLockClientConfigs.copyWithClient(config.timelock().get(), resolvedClient); + Supplier serverListConfigSupplier = + getServerListConfigSupplierForTimeLock(config, runtimeConfigSupplier); TimeLockMigrator migrator = - TimeLockMigrator.create(timeLockClientConfig, invalidator, userAgent, config.initializeAsync()); + TimeLockMigrator.create(serverListConfigSupplier, invalidator, userAgent, config.initializeAsync()); migrator.migrate(); // This can proceed async if config.initializeAsync() was set return ImmutableLockAndTimestampServices.copyOf( - createNamespacedRawRemoteServices(timeLockClientConfig, userAgent)) + getLockAndTimestampServices(serverListConfigSupplier, userAgent)) .withMigrator(migrator); } - private static LockAndTimestampServices createNamespacedRawRemoteServices( - TimeLockClientConfig config, - String userAgent) { - ServerListConfig namespacedServerListConfig = config.toNamespacedServerList(); - return getLockAndTimestampServices(namespacedServerListConfig, userAgent); + private static Supplier getServerListConfigSupplierForTimeLock( + AtlasDbConfig config, + Supplier runtimeConfigSupplier) { + Preconditions.checkState(config.timelock().isPresent(), + "Cannot create raw services from timelock without a timelock block!"); + TimeLockClientConfig clientConfig = config.timelock().get(); + String resolvedClient = OptionalResolver.resolve(clientConfig.client(), config.namespace()); + return () -> ServerListConfigs.parseInstallAndRuntimeConfigs( + clientConfig, + () -> runtimeConfigSupplier.get().timelockRuntime(), + resolvedClient); } private static LockAndTimestampServices getLockAndTimestampServices( - ServerListConfig timelockServerListConfig, + Supplier timelockServerListConfig, String userAgent) { LockService lockService = new ServiceCreator<>(LockService.class, userAgent) - .apply(timelockServerListConfig); + .applyDynamic(timelockServerListConfig); TimelockService timelockService = new ServiceCreator<>(TimelockService.class, userAgent) - .apply(timelockServerListConfig); + .applyDynamic(timelockServerListConfig); return ImmutableLockAndTimestampServices.builder() .lock(lockService) diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/startup/TimeLockMigrator.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/startup/TimeLockMigrator.java index 96fd1dc9203..1a97f413843 100644 --- a/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/startup/TimeLockMigrator.java +++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/startup/TimeLockMigrator.java @@ -15,10 +15,11 @@ */ package com.palantir.atlasdb.factory.startup; +import java.util.function.Supplier; + import com.palantir.async.initializer.AsyncInitializer; import com.palantir.atlasdb.AtlasDbConstants; import com.palantir.atlasdb.config.ServerListConfig; -import com.palantir.atlasdb.config.TimeLockClientConfig; import com.palantir.atlasdb.factory.ServiceCreator; import com.palantir.common.annotation.Idempotent; import com.palantir.timestamp.TimestampManagementService; @@ -40,19 +41,20 @@ private TimeLockMigrator( } public static TimeLockMigrator create( - TimeLockClientConfig config, + ServerListConfig serverListConfig, TimestampStoreInvalidator invalidator, String userAgent) { - return create(config, invalidator, userAgent, AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC); + return create(() -> serverListConfig, invalidator, userAgent, AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC); } public static TimeLockMigrator create( - TimeLockClientConfig config, + Supplier serverListConfigSupplier, TimestampStoreInvalidator invalidator, String userAgent, boolean initializeAsync) { TimestampManagementService remoteTimestampManagementService = - createRemoteManagementService(config, userAgent); + createRemoteManagementService( + serverListConfigSupplier, userAgent); return new TimeLockMigrator(invalidator, remoteTimestampManagementService, initializeAsync); } @@ -75,11 +77,10 @@ public void migrate() { } private static TimestampManagementService createRemoteManagementService( - TimeLockClientConfig timelockConfig, + Supplier serverListConfig, String userAgent) { - ServerListConfig serverListConfig = timelockConfig.toNamespacedServerList(); return new ServiceCreator<>(TimestampManagementService.class, userAgent) - .apply(serverListConfig); + .applyDynamic(serverListConfig); } @Override diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/http/AtlasDbHttpClients.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/http/AtlasDbHttpClients.java index 1305f155062..ed33543bccb 100644 --- a/atlasdb-config/src/main/java/com/palantir/atlasdb/http/AtlasDbHttpClients.java +++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/http/AtlasDbHttpClients.java @@ -19,17 +19,22 @@ import java.util.Collection; import java.util.List; import java.util.Optional; +import java.util.function.Function; +import java.util.function.Supplier; import javax.net.ssl.SSLSocketFactory; import com.codahale.metrics.MetricRegistry; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; +import com.palantir.atlasdb.config.ServerListConfig; import com.palantir.atlasdb.util.AtlasDbMetrics; +import com.palantir.remoting.api.config.service.ProxyConfiguration; +import com.palantir.remoting.api.config.ssl.SslConfiguration; public final class AtlasDbHttpClients { - private static final int QUICK_FEIGN_TIMEOUT_MILLIS = 1000; - private static final int QUICK_MAX_BACKOFF_MILLIS = 1000; + private static final int QUICK_FEIGN_TIMEOUT_MILLIS = 100; + private static final int QUICK_MAX_BACKOFF_MILLIS = 100; private AtlasDbHttpClients() { // Utility class @@ -143,6 +148,40 @@ public static T createProxyWithFailover( MetricRegistry.name(type)); } + public static T createLiveReloadingProxyWithFailover( + Supplier serverListConfigSupplier, + Function sslSocketFactoryCreator, + Function proxySelectorCreator, + Class type, + String userAgent) { + return AtlasDbMetrics.instrument( + type, + AtlasDbFeignTargetFactory.createLiveReloadingProxyWithFailover( + serverListConfigSupplier, sslSocketFactoryCreator, proxySelectorCreator, type, userAgent), + MetricRegistry.name(type)); + } + + @VisibleForTesting + static T createLiveReloadingProxyWithQuickFailoverForTesting( + Supplier serverListConfigSupplier, + Function sslSocketFactoryCreator, + Function proxySelectorCreator, + Class type, + String userAgent) { + return AtlasDbMetrics.instrument( + type, + AtlasDbFeignTargetFactory.createLiveReloadingProxyWithFailover( + serverListConfigSupplier, + sslSocketFactoryCreator, + proxySelectorCreator, + QUICK_FEIGN_TIMEOUT_MILLIS, + QUICK_FEIGN_TIMEOUT_MILLIS, + QUICK_MAX_BACKOFF_MILLIS, + type, + userAgent), + MetricRegistry.name(type)); + } + @VisibleForTesting static T createProxyWithQuickFailoverForTesting( Optional sslSocketFactory, diff --git a/atlasdb-config/src/test/java/com/palantir/atlasdb/config/AtlasDbRuntimeConfigSerializationTest.java b/atlasdb-config/src/test/java/com/palantir/atlasdb/config/AtlasDbRuntimeConfigDeserializationTest.java similarity index 66% rename from atlasdb-config/src/test/java/com/palantir/atlasdb/config/AtlasDbRuntimeConfigSerializationTest.java rename to atlasdb-config/src/test/java/com/palantir/atlasdb/config/AtlasDbRuntimeConfigDeserializationTest.java index 693a3f597fa..fc557ad8f83 100644 --- a/atlasdb-config/src/test/java/com/palantir/atlasdb/config/AtlasDbRuntimeConfigSerializationTest.java +++ b/atlasdb-config/src/test/java/com/palantir/atlasdb/config/AtlasDbRuntimeConfigDeserializationTest.java @@ -23,14 +23,21 @@ import org.junit.Test; -public class AtlasDbRuntimeConfigSerializationTest { +public class AtlasDbRuntimeConfigDeserializationTest { private static final File TEST_RUNTIME_CONFIG_FILE = new File( - AtlasDbConfigDeserializationTest.class.getResource("/runtime-config-block.yml").getPath()); + AtlasDbRuntimeConfigDeserializationTest.class.getResource("/runtime-config-block.yml").getPath()); @Test - public void canDeserializeAtlasDbConfig() throws IOException { + public void canDeserializeRuntimeConfig() throws IOException { AtlasDbRuntimeConfig runtimeConfig = AtlasDbConfigs.OBJECT_MAPPER.readValue(TEST_RUNTIME_CONFIG_FILE, AtlasDbRuntimeConfig.class); assertThat(runtimeConfig.timestampClient().enableTimestampBatching()).isTrue(); + + assertThat(runtimeConfig.timelockRuntime()).isPresent(); + assertThat(runtimeConfig.timelockRuntime().get().serversList().servers()) + .containsExactlyInAnyOrder( + "https://foo1:12345", + "https://foo2:8421", + "https://foo3:9421"); } } diff --git a/atlasdb-config/src/test/java/com/palantir/atlasdb/config/ServerListConfigsTest.java b/atlasdb-config/src/test/java/com/palantir/atlasdb/config/ServerListConfigsTest.java new file mode 100644 index 00000000000..1f5b16c11a3 --- /dev/null +++ b/atlasdb-config/src/test/java/com/palantir/atlasdb/config/ServerListConfigsTest.java @@ -0,0 +1,80 @@ +/* + * Copyright 2017 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the BSD-3 License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.atlasdb.config; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Optional; + +import org.junit.Test; + +public class ServerListConfigsTest { + private static final String CLIENT = "client"; + + private static final ImmutableServerListConfig SERVERS_LIST_1 = ImmutableServerListConfig.builder() + .addServers("one") + .build(); + private static final ImmutableServerListConfig SERVERS_LIST_2 = ImmutableServerListConfig.builder() + .addServers("one", "two") + .build(); + private static final ImmutableServerListConfig SERVERS_LIST_3 = ImmutableServerListConfig.builder() + .addServers("three/") + .build(); + + private static final TimeLockClientConfig INSTALL_CONFIG = ImmutableTimeLockClientConfig.builder() + .serversList(SERVERS_LIST_1) + .build(); + private static final TimeLockRuntimeConfig RUNTIME_CONFIG = ImmutableTimeLockRuntimeConfig.builder() + .serversList(SERVERS_LIST_2) + .build(); + + @Test + public void namespacingAddsClientNameCorrectly() { + ServerListConfig namespacedServersList = ServerListConfigs.namespaceUris(SERVERS_LIST_1, CLIENT); + assertThat(namespacedServersList.servers()).containsExactly("one/client"); + } + + @Test + public void namespacingAddsClientNameToAllServers() { + ServerListConfig namespacedServersList = ServerListConfigs.namespaceUris(SERVERS_LIST_2, CLIENT); + assertThat(namespacedServersList.servers()).containsExactlyInAnyOrder("one/client", "two/client"); + } + + @Test + public void namespacingCanDealWithTrailingSlash() { + ServerListConfig namespacedServersList = ServerListConfigs.namespaceUris(SERVERS_LIST_3, CLIENT); + assertThat(namespacedServersList.servers()).containsExactlyInAnyOrder("three/client"); + } + + @Test + public void prioritisesRuntimeConfigIfAvailable() { + ServerListConfig resolvedConfig = ServerListConfigs.parseInstallAndRuntimeConfigs( + INSTALL_CONFIG, + () -> Optional.of(RUNTIME_CONFIG), + CLIENT); + assertThat(resolvedConfig.servers()).containsExactlyInAnyOrder("one/client", "two/client"); + } + + @Test + public void fallsBackToInstallConfigIfRuntimeConfigNotAvailable() { + ServerListConfig resolvedConfig = ServerListConfigs.parseInstallAndRuntimeConfigs( + INSTALL_CONFIG, + Optional::empty, + CLIENT); + assertThat(resolvedConfig.servers()).containsExactlyInAnyOrder("one/client"); + } +} diff --git a/atlasdb-config/src/test/java/com/palantir/atlasdb/factory/TransactionManagersTest.java b/atlasdb-config/src/test/java/com/palantir/atlasdb/factory/TransactionManagersTest.java index 5bb5a1dca5f..d01c39fa6f2 100644 --- a/atlasdb-config/src/test/java/com/palantir/atlasdb/factory/TransactionManagersTest.java +++ b/atlasdb-config/src/test/java/com/palantir/atlasdb/factory/TransactionManagersTest.java @@ -193,6 +193,7 @@ public void setup() throws JsonProcessingException { runtimeConfig = mock(AtlasDbRuntimeConfig.class); when(runtimeConfig.timestampClient()).thenReturn(ImmutableTimestampClientConfig.of(false)); + when(runtimeConfig.timelockRuntime()).thenReturn(Optional.empty()); environment = mock(Consumer.class); @@ -487,7 +488,7 @@ private void setupLeaderBlockInConfig() throws IOException { private TransactionManagers.LockAndTimestampServices getLockAndTimestampServices() { return TransactionManagers.createLockAndTimestampServices( config, - () -> runtimeConfig.timestampClient(), + () -> runtimeConfig, environment, LockServiceImpl::create, InMemoryTimestampService::new, @@ -512,7 +513,7 @@ private void verifyUserAgentOnTimestampAndLockRequests(String timestampPath, Str TransactionManagers.LockAndTimestampServices lockAndTimestamp = TransactionManagers.createLockAndTimestampServices( config, - () -> ImmutableTimestampClientConfig.of(false), + () -> runtimeConfig, environment, LockServiceImpl::create, InMemoryTimestampService::new, @@ -544,7 +545,7 @@ private TransactionManagers.LockAndTimestampServices createLockAndTimestampServi AtlasDbConfig atlasDbConfig, AtlasDbRuntimeConfig atlasDbRuntimeConfig) { return TransactionManagers.createLockAndTimestampServices( atlasDbConfig, - atlasDbRuntimeConfig::timestampClient, + () -> atlasDbRuntimeConfig, environment, LockServiceImpl::create, InMemoryTimestampService::new, diff --git a/atlasdb-config/src/test/java/com/palantir/atlasdb/factory/startup/TimeLockMigratorTest.java b/atlasdb-config/src/test/java/com/palantir/atlasdb/factory/startup/TimeLockMigratorTest.java index 4cce918b8ae..ca387aeccdf 100644 --- a/atlasdb-config/src/test/java/com/palantir/atlasdb/factory/startup/TimeLockMigratorTest.java +++ b/atlasdb-config/src/test/java/com/palantir/atlasdb/factory/startup/TimeLockMigratorTest.java @@ -61,7 +61,6 @@ public class TimeLockMigratorTest { private static final String USER_AGENT = "user-agent (123456789)"; - private ServerListConfig defaultServerListConfig; private TimeLockClientConfig timelockConfig; private final TimestampStoreInvalidator invalidator = mock(TimestampStoreInvalidator.class); @@ -83,7 +82,7 @@ public void setUp() { String serverUri = String.format("http://%s:%s", WireMockConfiguration.DEFAULT_BIND_ADDRESS, wireMockRule.port()); - defaultServerListConfig = ImmutableServerListConfig.builder().addServers(serverUri).build(); + ServerListConfig defaultServerListConfig = ImmutableServerListConfig.builder().addServers(serverUri).build(); timelockConfig = ImmutableTimeLockClientConfig.builder() .client("testClient") .serversList(defaultServerListConfig) @@ -94,7 +93,8 @@ public void setUp() { public void propagatesBackupTimestampToFastForwardOnRemoteService() { wireMockRule.stubFor(TEST_MAPPING.willReturn(aResponse().withStatus(204))); - TimeLockMigrator migrator = TimeLockMigrator.create(timelockConfig, invalidator, USER_AGENT); + TimeLockMigrator migrator = + TimeLockMigrator.create(timelockConfig.toNamespacedServerList(), invalidator, USER_AGENT); migrator.migrate(); wireMockRule.verify(getRequestedFor(urlEqualTo(PING_ENDPOINT))); @@ -106,7 +106,8 @@ public void propagatesBackupTimestampToFastForwardOnRemoteService() { public void invalidationDoesNotProceedIfTimelockPingUnsuccessful() { wireMockRule.stubFor(PING_MAPPING.willReturn(aResponse().withStatus(500))); - TimeLockMigrator migrator = TimeLockMigrator.create(timelockConfig, invalidator, USER_AGENT); + TimeLockMigrator migrator = + TimeLockMigrator.create(timelockConfig.toNamespacedServerList(), invalidator, USER_AGENT); assertThatThrownBy(migrator::migrate).isInstanceOf(IllegalStateException.class); verify(invalidator, never()).backupAndInvalidate(); } @@ -115,7 +116,8 @@ public void invalidationDoesNotProceedIfTimelockPingUnsuccessful() { public void migrationDoesNotProceedIfInvalidationFails() { when(invalidator.backupAndInvalidate()).thenThrow(new IllegalStateException()); - TimeLockMigrator migrator = TimeLockMigrator.create(timelockConfig, invalidator, USER_AGENT); + TimeLockMigrator migrator = + TimeLockMigrator.create(timelockConfig.toNamespacedServerList(), invalidator, USER_AGENT); assertThatThrownBy(migrator::migrate).isInstanceOf(IllegalStateException.class); wireMockRule.verify(0, postRequestedFor(urlEqualTo(TEST_ENDPOINT))); } @@ -135,7 +137,8 @@ public void asyncMigrationProceedsIfTimeLockInitiallyUnavailable() throws Interr wireMockRule.stubFor(TEST_MAPPING.willReturn(aResponse().withStatus(204))); - TimeLockMigrator migrator = TimeLockMigrator.create(timelockConfig, invalidator, USER_AGENT, true); + TimeLockMigrator migrator = + TimeLockMigrator.create(() -> timelockConfig.toNamespacedServerList(), invalidator, USER_AGENT, true); migrator.migrate(); Awaitility.await() @@ -163,7 +166,8 @@ public Long answer(InvocationOnMock invocation) throws Throwable { }); wireMockRule.stubFor(TEST_MAPPING.willReturn(aResponse().withStatus(204))); - TimeLockMigrator migrator = TimeLockMigrator.create(timelockConfig, invalidator, USER_AGENT, true); + TimeLockMigrator migrator = + TimeLockMigrator.create(() -> timelockConfig.toNamespacedServerList(), invalidator, USER_AGENT, true); migrator.migrate(); Awaitility.await() diff --git a/atlasdb-config/src/test/java/com/palantir/atlasdb/http/AtlasDbHttpClientsTest.java b/atlasdb-config/src/test/java/com/palantir/atlasdb/http/AtlasDbHttpClientsTest.java index 8259a958517..77deb189615 100644 --- a/atlasdb-config/src/test/java/com/palantir/atlasdb/http/AtlasDbHttpClientsTest.java +++ b/atlasdb-config/src/test/java/com/palantir/atlasdb/http/AtlasDbHttpClientsTest.java @@ -15,6 +15,7 @@ */ package com.palantir.atlasdb.http; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; @@ -25,8 +26,10 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; import java.net.ProxySelector; +import java.util.List; import java.util.Optional; import java.util.Set; +import java.util.concurrent.TimeUnit; import javax.net.ssl.SSLSocketFactory; import javax.ws.rs.GET; @@ -43,8 +46,12 @@ import com.github.tomakehurst.wiremock.core.WireMockConfiguration; import com.github.tomakehurst.wiremock.junit.WireMockRule; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.util.concurrent.Uninterruptibles; +import com.palantir.atlasdb.config.ImmutableServerListConfig; import com.palantir.atlasdb.factory.ServiceCreator; import com.palantir.remoting.api.config.service.ProxyConfiguration; +import com.palantir.remoting3.config.ssl.SslSocketFactories; public class AtlasDbHttpClientsTest { private static final Optional NO_SSL = Optional.empty(); @@ -138,6 +145,33 @@ public void httpProxyIsConfigurableOnClientRequests() { availableServer.verify(0, getRequestedFor(urlMatching(TEST_ENDPOINT))); } + @Test + public void canLiveReloadServersList() { + unavailableServer.stubFor(ENDPOINT_MAPPING.willReturn(aResponse().withStatus(503))); + + List servers = Lists.newArrayList(getUriForPort(unavailablePort)); + + TestResource client = AtlasDbHttpClients.createLiveReloadingProxyWithQuickFailoverForTesting( + () -> ImmutableServerListConfig.builder() + .servers(servers) + .build(), + SslSocketFactories::createSslSocketFactory, + unused -> ProxySelector.getDefault(), + TestResource.class, + "user (123)"); + + // actually a Feign RetryableException but that's not on our classpath + assertThatThrownBy(client::getTestNumber).isInstanceOf(RuntimeException.class); + + servers.add(getUriForPort(availablePort)); + Uninterruptibles.sleepUninterruptibly( + PollingRefreshable.DEFAULT_REFRESH_INTERVAL.getSeconds() + 1, TimeUnit.SECONDS); + + int response = client.getTestNumber(); + assertThat(response, equalTo(TEST_NUMBER)); + unavailableServer.verify(getRequestedFor(urlMatching(TEST_ENDPOINT))); + } + private static String getUriForPort(int port) { return String.format("http://%s:%s", WireMockConfiguration.DEFAULT_BIND_ADDRESS, port); } diff --git a/atlasdb-config/src/test/resources/runtime-config-block.yml b/atlasdb-config/src/test/resources/runtime-config-block.yml index 855da31869d..138f646b146 100644 --- a/atlasdb-config/src/test/resources/runtime-config-block.yml +++ b/atlasdb-config/src/test/resources/runtime-config-block.yml @@ -1,2 +1,9 @@ timestampClient: enableTimestampBatching: true + +timelockRuntime: + serversList: + servers: + - "https://foo1:12345" + - "https://foo2:8421" + - "https://foo3:9421" \ No newline at end of file diff --git a/atlasdb-config/versions.lock b/atlasdb-config/versions.lock index b1c67a0048b..53ac2e59f43 100644 --- a/atlasdb-config/versions.lock +++ b/atlasdb-config/versions.lock @@ -372,7 +372,10 @@ ] }, "com.palantir.remoting-api:service-config": { - "locked": "1.4.0" + "locked": "1.4.0", + "transitive": [ + "com.palantir.atlasdb:atlasdb-feign" + ] }, "com.palantir.remoting-api:ssl-config": { "locked": "1.4.0", @@ -560,7 +563,8 @@ "javax.validation:validation-api": { "locked": "1.1.0.Final", "transitive": [ - "com.palantir.atlasdb:atlasdb-api" + "com.palantir.atlasdb:atlasdb-api", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1016,7 +1020,10 @@ ] }, "com.palantir.remoting-api:service-config": { - "locked": "1.4.0" + "locked": "1.4.0", + "transitive": [ + "com.palantir.atlasdb:atlasdb-feign" + ] }, "com.palantir.remoting-api:ssl-config": { "locked": "1.4.0", @@ -1204,7 +1211,8 @@ "javax.validation:validation-api": { "locked": "1.1.0.Final", "transitive": [ - "com.palantir.atlasdb:atlasdb-api" + "com.palantir.atlasdb:atlasdb-api", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/atlasdb-console-distribution/versions.lock b/atlasdb-console-distribution/versions.lock index 750755ac34a..6f36e4794a1 100644 --- a/atlasdb-console-distribution/versions.lock +++ b/atlasdb-console-distribution/versions.lock @@ -543,7 +543,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -827,7 +828,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/atlasdb-console/versions.lock b/atlasdb-console/versions.lock index 4a79af18d8f..1a95fe81a62 100644 --- a/atlasdb-console/versions.lock +++ b/atlasdb-console/versions.lock @@ -407,7 +407,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -617,7 +618,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1125,7 +1127,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -1335,7 +1338,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/atlasdb-dagger/versions.lock b/atlasdb-dagger/versions.lock index 06ee9a23d6c..b086407177d 100644 --- a/atlasdb-dagger/versions.lock +++ b/atlasdb-dagger/versions.lock @@ -410,7 +410,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -618,7 +619,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1118,7 +1120,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -1326,7 +1329,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/atlasdb-dbkvs-tests/versions.lock b/atlasdb-dbkvs-tests/versions.lock index f1b5137710c..e93fc7897a8 100644 --- a/atlasdb-dbkvs-tests/versions.lock +++ b/atlasdb-dbkvs-tests/versions.lock @@ -54,7 +54,8 @@ "com.palantir.remoting2:jackson-support", "com.palantir.remoting2:tracing", "com.palantir.remoting3:jackson-support", - "com.palantir.remoting3:tracing" + "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor": { @@ -80,7 +81,8 @@ "com.palantir.remoting2:jackson-support", "com.palantir.remoting2:tracing", "com.palantir.remoting3:jackson-support", - "com.palantir.remoting3:tracing" + "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-jsr310": { @@ -376,10 +378,17 @@ "com.palantir.remoting3:error-handling" ] }, + "com.palantir.remoting-api:service-config": { + "locked": "1.4.0", + "transitive": [ + "com.palantir.atlasdb:atlasdb-feign" + ] + }, "com.palantir.remoting-api:ssl-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-api" + "com.palantir.atlasdb:atlasdb-api", + "com.palantir.remoting-api:service-config" ] }, "com.palantir.remoting-api:tracing": { @@ -456,6 +465,12 @@ "com.palantir.tritium:tritium-tracing" ] }, + "com.palantir.tokens:auth-tokens": { + "locked": "3.0.0", + "transitive": [ + "com.palantir.remoting-api:service-config" + ] + }, "com.palantir.tritium:tritium-api": { "locked": "0.8.3", "transitive": [ @@ -560,7 +575,8 @@ "javax.validation:validation-api": { "locked": "1.1.0.Final", "transitive": [ - "com.palantir.atlasdb:atlasdb-api" + "com.palantir.atlasdb:atlasdb-api", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -671,6 +687,7 @@ "com.palantir.remoting2:tracing", "com.palantir.remoting3:error-handling", "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens", "com.palantir.tritium:tritium-core", "com.palantir.tritium:tritium-lib", "com.palantir.tritium:tritium-metrics", @@ -748,7 +765,8 @@ "com.palantir.remoting2:jackson-support", "com.palantir.remoting2:tracing", "com.palantir.remoting3:jackson-support", - "com.palantir.remoting3:tracing" + "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor": { @@ -774,7 +792,8 @@ "com.palantir.remoting2:jackson-support", "com.palantir.remoting2:tracing", "com.palantir.remoting3:jackson-support", - "com.palantir.remoting3:tracing" + "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-jsr310": { @@ -1070,10 +1089,17 @@ "com.palantir.remoting3:error-handling" ] }, + "com.palantir.remoting-api:service-config": { + "locked": "1.4.0", + "transitive": [ + "com.palantir.atlasdb:atlasdb-feign" + ] + }, "com.palantir.remoting-api:ssl-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-api" + "com.palantir.atlasdb:atlasdb-api", + "com.palantir.remoting-api:service-config" ] }, "com.palantir.remoting-api:tracing": { @@ -1150,6 +1176,12 @@ "com.palantir.tritium:tritium-tracing" ] }, + "com.palantir.tokens:auth-tokens": { + "locked": "3.0.0", + "transitive": [ + "com.palantir.remoting-api:service-config" + ] + }, "com.palantir.tritium:tritium-api": { "locked": "0.8.3", "transitive": [ @@ -1254,7 +1286,8 @@ "javax.validation:validation-api": { "locked": "1.1.0.Final", "transitive": [ - "com.palantir.atlasdb:atlasdb-api" + "com.palantir.atlasdb:atlasdb-api", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1365,6 +1398,7 @@ "com.palantir.remoting2:tracing", "com.palantir.remoting3:error-handling", "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens", "com.palantir.tritium:tritium-core", "com.palantir.tritium:tritium-lib", "com.palantir.tritium:tritium-metrics", diff --git a/atlasdb-dropwizard-bundle/versions.lock b/atlasdb-dropwizard-bundle/versions.lock index 54750bea084..c49ac9257ff 100644 --- a/atlasdb-dropwizard-bundle/versions.lock +++ b/atlasdb-dropwizard-bundle/versions.lock @@ -516,7 +516,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -926,6 +927,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-api", "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "org.glassfish.jersey.core:jersey-server", "org.glassfish.jersey.ext:jersey-bean-validation", "org.hibernate:hibernate-validator" @@ -1853,7 +1855,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -2263,6 +2266,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-api", "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "org.glassfish.jersey.core:jersey-server", "org.glassfish.jersey.ext:jersey-bean-validation", "org.hibernate:hibernate-validator" diff --git a/atlasdb-ete-tests/versions.lock b/atlasdb-ete-tests/versions.lock index c3d088c5922..e84fdf95984 100644 --- a/atlasdb-ete-tests/versions.lock +++ b/atlasdb-ete-tests/versions.lock @@ -541,7 +541,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -978,6 +979,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-api", "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "org.glassfish.jersey.core:jersey-server", "org.glassfish.jersey.ext:jersey-bean-validation", "org.hibernate:hibernate-validator" @@ -1987,7 +1989,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -2440,6 +2443,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-api", "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "org.glassfish.jersey.core:jersey-server", "org.glassfish.jersey.ext:jersey-bean-validation", "org.hibernate:hibernate-validator" diff --git a/atlasdb-feign/build.gradle b/atlasdb-feign/build.gradle index 53d7afbf1d4..ed21fda2ff6 100644 --- a/atlasdb-feign/build.gradle +++ b/atlasdb-feign/build.gradle @@ -27,7 +27,9 @@ configurations { dependencies { explicitShadow project(':lock-api') explicitShadow group: 'com.squareup.okhttp3', name: 'okhttp' + explicitShadow group: 'com.palantir.remoting-api', name: 'service-config' explicitShadow group: 'com.palantir.remoting3', name: 'refresh-utils' + explicitShadow group: 'javax.validation', name: 'validation-api' toBeShaded group: 'com.palantir.remoting2', name: 'error-handling' toBeShaded group: 'com.palantir.remoting2', name: 'jackson-support' diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/config/ServerListConfig.java b/atlasdb-feign/src/main/java/com/palantir/atlasdb/config/ServerListConfig.java similarity index 100% rename from atlasdb-config/src/main/java/com/palantir/atlasdb/config/ServerListConfig.java rename to atlasdb-feign/src/main/java/com/palantir/atlasdb/config/ServerListConfig.java diff --git a/atlasdb-feign/src/main/java/com/palantir/atlasdb/http/AtlasDbFeignTargetFactory.java b/atlasdb-feign/src/main/java/com/palantir/atlasdb/http/AtlasDbFeignTargetFactory.java index c821f907e7e..f808b2c8f14 100644 --- a/atlasdb-feign/src/main/java/com/palantir/atlasdb/http/AtlasDbFeignTargetFactory.java +++ b/atlasdb-feign/src/main/java/com/palantir/atlasdb/http/AtlasDbFeignTargetFactory.java @@ -19,11 +19,18 @@ import java.net.ProxySelector; import java.util.Collection; import java.util.Optional; +import java.util.function.Function; +import java.util.function.Supplier; import javax.net.ssl.SSLSocketFactory; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.google.common.reflect.Reflection; +import com.palantir.atlasdb.config.ServerListConfig; +import com.palantir.remoting.api.config.service.ProxyConfiguration; +import com.palantir.remoting.api.config.ssl.SslConfiguration; +import com.palantir.remoting3.ext.refresh.RefreshableProxyInvocationHandler; import feign.Client; import feign.Contract; @@ -140,4 +147,46 @@ private static T createProxyWithFailover( .target(failoverFeignTarget); } + public static T createLiveReloadingProxyWithFailover( + Supplier serverListConfigSupplier, + Function sslSocketFactoryCreator, + Function proxySelectorCreator, + Class type, + String userAgent) { + return createLiveReloadingProxyWithFailover( + serverListConfigSupplier, + sslSocketFactoryCreator, + proxySelectorCreator, + DEFAULT_FEIGN_OPTIONS.connectTimeoutMillis(), + DEFAULT_FEIGN_OPTIONS.readTimeoutMillis(), + FailoverFeignTarget.DEFAULT_MAX_BACKOFF_MILLIS, + type, + userAgent); + } + + public static T createLiveReloadingProxyWithFailover( + Supplier serverListConfigSupplier, + Function sslSocketFactoryCreator, + Function proxySelectorCreator, + int feignConnectTimeout, + int feignReadTimeout, + int maxBackoffMillis, + Class type, + String userAgent) { + PollingRefreshable configPollingRefreshable = + PollingRefreshable.create(serverListConfigSupplier); + return Reflection.newProxy( + type, + RefreshableProxyInvocationHandler.create( + configPollingRefreshable.getRefreshable(), + serverListConfig -> createProxyWithFailover( + serverListConfig.sslConfiguration().map(sslSocketFactoryCreator), + serverListConfig.proxyConfiguration().map(proxySelectorCreator), + serverListConfig.servers(), + feignConnectTimeout, + feignReadTimeout, + maxBackoffMillis, + type, + userAgent))); + } } diff --git a/atlasdb-feign/versions.lock b/atlasdb-feign/versions.lock index b9f5b599154..5fbf802ac48 100644 --- a/atlasdb-feign/versions.lock +++ b/atlasdb-feign/versions.lock @@ -28,8 +28,10 @@ "com.fasterxml.jackson.module:jackson-module-afterburner", "com.netflix.feign:feign-jackson", "com.palantir.atlasdb:lock-api", + "com.palantir.remoting-api:ssl-config", "com.palantir.remoting2:error-handling", - "com.palantir.remoting2:jackson-support" + "com.palantir.remoting2:jackson-support", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-guava": { @@ -43,7 +45,8 @@ "locked": "2.6.7", "transitive": [ "com.palantir.remoting2:error-handling", - "com.palantir.remoting2:jackson-support" + "com.palantir.remoting2:jackson-support", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-jsr310": { @@ -123,6 +126,15 @@ "com.palantir.atlasdb:lock-api" ] }, + "com.palantir.remoting-api:service-config": { + "locked": "1.4.0" + }, + "com.palantir.remoting-api:ssl-config": { + "locked": "1.4.0", + "transitive": [ + "com.palantir.remoting-api:service-config" + ] + }, "com.palantir.remoting2:error-handling": { "locked": "2.3.0" }, @@ -143,6 +155,12 @@ "com.palantir.atlasdb:timestamp-api" ] }, + "com.palantir.tokens:auth-tokens": { + "locked": "3.0.0", + "transitive": [ + "com.palantir.remoting-api:service-config" + ] + }, "com.squareup.okhttp3:okhttp": { "locked": "3.8.1", "transitive": [ @@ -161,6 +179,9 @@ "com.palantir.atlasdb:atlasdb-commons" ] }, + "javax.validation:validation-api": { + "locked": "1.1.0.Final" + }, "javax.ws.rs:javax.ws.rs-api": { "locked": "2.0.1", "transitive": [ @@ -187,6 +208,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-commons", "com.palantir.remoting2:error-handling", + "com.palantir.tokens:auth-tokens", "io.dropwizard.metrics:metrics-core" ] } @@ -220,8 +242,10 @@ "com.fasterxml.jackson.module:jackson-module-afterburner", "com.netflix.feign:feign-jackson", "com.palantir.atlasdb:lock-api", + "com.palantir.remoting-api:ssl-config", "com.palantir.remoting2:error-handling", - "com.palantir.remoting2:jackson-support" + "com.palantir.remoting2:jackson-support", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-guava": { @@ -235,7 +259,8 @@ "locked": "2.6.7", "transitive": [ "com.palantir.remoting2:error-handling", - "com.palantir.remoting2:jackson-support" + "com.palantir.remoting2:jackson-support", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-jsr310": { @@ -315,6 +340,15 @@ "com.palantir.atlasdb:lock-api" ] }, + "com.palantir.remoting-api:service-config": { + "locked": "1.4.0" + }, + "com.palantir.remoting-api:ssl-config": { + "locked": "1.4.0", + "transitive": [ + "com.palantir.remoting-api:service-config" + ] + }, "com.palantir.remoting2:error-handling": { "locked": "2.3.0" }, @@ -335,6 +369,12 @@ "com.palantir.atlasdb:timestamp-api" ] }, + "com.palantir.tokens:auth-tokens": { + "locked": "3.0.0", + "transitive": [ + "com.palantir.remoting-api:service-config" + ] + }, "com.squareup.okhttp3:okhttp": { "locked": "3.8.1", "transitive": [ @@ -353,6 +393,9 @@ "com.palantir.atlasdb:atlasdb-commons" ] }, + "javax.validation:validation-api": { + "locked": "1.1.0.Final" + }, "javax.ws.rs:javax.ws.rs-api": { "locked": "2.0.1", "transitive": [ @@ -379,6 +422,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-commons", "com.palantir.remoting2:error-handling", + "com.palantir.tokens:auth-tokens", "io.dropwizard.metrics:metrics-core" ] } diff --git a/atlasdb-jepsen-tests/versions.lock b/atlasdb-jepsen-tests/versions.lock index 69aaf58fd80..67b3eed33da 100644 --- a/atlasdb-jepsen-tests/versions.lock +++ b/atlasdb-jepsen-tests/versions.lock @@ -398,7 +398,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -599,7 +600,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1093,7 +1095,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -1294,7 +1297,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/atlasdb-perf/versions.lock b/atlasdb-perf/versions.lock index 8c2aeec33d3..6b7e6cf667a 100644 --- a/atlasdb-perf/versions.lock +++ b/atlasdb-perf/versions.lock @@ -569,7 +569,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -854,7 +855,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1640,7 +1642,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -1925,7 +1928,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/atlasdb-service-server/versions.lock b/atlasdb-service-server/versions.lock index 2b533f8d25d..9470ffa273c 100644 --- a/atlasdb-service-server/versions.lock +++ b/atlasdb-service-server/versions.lock @@ -426,7 +426,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -782,6 +783,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-api", "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "org.glassfish.jersey.core:jersey-server", "org.glassfish.jersey.ext:jersey-bean-validation", "org.hibernate:hibernate-validator" @@ -1626,7 +1628,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -2032,6 +2035,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-api", "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "org.glassfish.jersey.core:jersey-server", "org.glassfish.jersey.ext:jersey-bean-validation", "org.hibernate:hibernate-validator" diff --git a/atlasdb-service/versions.lock b/atlasdb-service/versions.lock index 4c16cc9c464..eaa4b96a425 100644 --- a/atlasdb-service/versions.lock +++ b/atlasdb-service/versions.lock @@ -398,7 +398,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -603,7 +604,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1091,7 +1093,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -1296,7 +1299,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/atlasdb-tests-shared/versions.lock b/atlasdb-tests-shared/versions.lock index 86b904273ca..668499a09e3 100644 --- a/atlasdb-tests-shared/versions.lock +++ b/atlasdb-tests-shared/versions.lock @@ -53,7 +53,8 @@ "com.palantir.remoting2:jackson-support", "com.palantir.remoting2:tracing", "com.palantir.remoting3:jackson-support", - "com.palantir.remoting3:tracing" + "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor": { @@ -79,7 +80,8 @@ "com.palantir.remoting2:jackson-support", "com.palantir.remoting2:tracing", "com.palantir.remoting3:jackson-support", - "com.palantir.remoting3:tracing" + "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-jsr310": { @@ -294,10 +296,17 @@ "com.palantir.remoting3:error-handling" ] }, + "com.palantir.remoting-api:service-config": { + "locked": "1.4.0", + "transitive": [ + "com.palantir.atlasdb:atlasdb-feign" + ] + }, "com.palantir.remoting-api:ssl-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-api" + "com.palantir.atlasdb:atlasdb-api", + "com.palantir.remoting-api:service-config" ] }, "com.palantir.remoting-api:tracing": { @@ -369,6 +378,12 @@ "com.palantir.tritium:tritium-tracing" ] }, + "com.palantir.tokens:auth-tokens": { + "locked": "3.0.0", + "transitive": [ + "com.palantir.remoting-api:service-config" + ] + }, "com.palantir.tritium:tritium-api": { "locked": "0.8.3", "transitive": [ @@ -453,7 +468,8 @@ "javax.validation:validation-api": { "locked": "1.1.0.Final", "transitive": [ - "com.palantir.atlasdb:atlasdb-api" + "com.palantir.atlasdb:atlasdb-api", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -538,6 +554,7 @@ "com.palantir.remoting2:tracing", "com.palantir.remoting3:error-handling", "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens", "com.palantir.tritium:tritium-core", "com.palantir.tritium:tritium-lib", "com.palantir.tritium:tritium-metrics", @@ -613,7 +630,8 @@ "com.palantir.remoting2:jackson-support", "com.palantir.remoting2:tracing", "com.palantir.remoting3:jackson-support", - "com.palantir.remoting3:tracing" + "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor": { @@ -639,7 +657,8 @@ "com.palantir.remoting2:jackson-support", "com.palantir.remoting2:tracing", "com.palantir.remoting3:jackson-support", - "com.palantir.remoting3:tracing" + "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens" ] }, "com.fasterxml.jackson.datatype:jackson-datatype-jsr310": { @@ -854,10 +873,17 @@ "com.palantir.remoting3:error-handling" ] }, + "com.palantir.remoting-api:service-config": { + "locked": "1.4.0", + "transitive": [ + "com.palantir.atlasdb:atlasdb-feign" + ] + }, "com.palantir.remoting-api:ssl-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-api" + "com.palantir.atlasdb:atlasdb-api", + "com.palantir.remoting-api:service-config" ] }, "com.palantir.remoting-api:tracing": { @@ -929,6 +955,12 @@ "com.palantir.tritium:tritium-tracing" ] }, + "com.palantir.tokens:auth-tokens": { + "locked": "3.0.0", + "transitive": [ + "com.palantir.remoting-api:service-config" + ] + }, "com.palantir.tritium:tritium-api": { "locked": "0.8.3", "transitive": [ @@ -1013,7 +1045,8 @@ "javax.validation:validation-api": { "locked": "1.1.0.Final", "transitive": [ - "com.palantir.atlasdb:atlasdb-api" + "com.palantir.atlasdb:atlasdb-api", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1098,6 +1131,7 @@ "com.palantir.remoting2:tracing", "com.palantir.remoting3:error-handling", "com.palantir.remoting3:tracing", + "com.palantir.tokens:auth-tokens", "com.palantir.tritium:tritium-core", "com.palantir.tritium:tritium-lib", "com.palantir.tritium:tritium-metrics", diff --git a/timelock-agent/versions.lock b/timelock-agent/versions.lock index 6a878b5483c..27c3cb91876 100644 --- a/timelock-agent/versions.lock +++ b/timelock-agent/versions.lock @@ -387,7 +387,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -579,7 +580,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1054,7 +1056,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -1246,7 +1249,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/timelock-impl/versions.lock b/timelock-impl/versions.lock index bab7238794a..a01408833e4 100644 --- a/timelock-impl/versions.lock +++ b/timelock-impl/versions.lock @@ -375,7 +375,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -565,7 +566,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { @@ -1028,7 +1030,8 @@ "com.palantir.remoting-api:service-config": { "locked": "1.4.0", "transitive": [ - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "com.palantir.remoting-api:ssl-config": { @@ -1218,7 +1221,8 @@ "locked": "1.1.0.Final", "transitive": [ "com.palantir.atlasdb:atlasdb-api", - "com.palantir.atlasdb:atlasdb-config" + "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign" ] }, "javax.ws.rs:javax.ws.rs-api": { diff --git a/timelock-server-distribution/versions.lock b/timelock-server-distribution/versions.lock index 082f99a13e6..9b7e8b7ac3b 100644 --- a/timelock-server-distribution/versions.lock +++ b/timelock-server-distribution/versions.lock @@ -598,6 +598,7 @@ "locked": "1.4.0", "transitive": [ "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "com.palantir.atlasdb:timelock-agent" ] }, @@ -1052,6 +1053,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-api", "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "org.glassfish.jersey.core:jersey-server", "org.glassfish.jersey.ext:jersey-bean-validation", "org.hibernate:hibernate-validator" diff --git a/timelock-server/versions.lock b/timelock-server/versions.lock index 9fe89f281a9..2ba066b95ab 100644 --- a/timelock-server/versions.lock +++ b/timelock-server/versions.lock @@ -455,6 +455,7 @@ "locked": "1.4.0", "transitive": [ "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "com.palantir.atlasdb:timelock-agent" ] }, @@ -829,6 +830,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-api", "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "org.glassfish.jersey.core:jersey-server", "org.glassfish.jersey.ext:jersey-bean-validation", "org.hibernate:hibernate-validator" @@ -1785,6 +1787,7 @@ "locked": "1.4.0", "transitive": [ "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "com.palantir.atlasdb:timelock-agent" ] }, @@ -2230,6 +2233,7 @@ "transitive": [ "com.palantir.atlasdb:atlasdb-api", "com.palantir.atlasdb:atlasdb-config", + "com.palantir.atlasdb:atlasdb-feign", "org.glassfish.jersey.core:jersey-server", "org.glassfish.jersey.ext:jersey-bean-validation", "org.hibernate:hibernate-validator"