Default Lettuce shutdownQuietPeriod to zero.

Use a lower timeout for faster shutdown. Also, the quiet period is no longer configured through the shutdown timeout.

Closes #2945
This commit is contained in:
Mark Paluch
2024-08-08 15:48:48 +02:00
parent ba2c9bae90
commit 369b549b3c
4 changed files with 9 additions and 10 deletions

View File

@@ -51,7 +51,7 @@ class DefaultLettuceClientConfiguration implements LettuceClientConfiguration {
DefaultLettuceClientConfiguration(boolean useSsl, SslVerifyMode verifyMode, boolean startTls,
@Nullable ClientResources clientResources, @Nullable ClientOptions clientOptions, @Nullable String clientName,
@Nullable ReadFrom readFrom, @Nullable RedisCredentialsProviderFactory redisCredentialsProviderFactory,
Duration timeout, Duration shutdownTimeout, @Nullable Duration shutdownQuietPeriod) {
Duration timeout, Duration shutdownTimeout, Duration shutdownQuietPeriod) {
this.useSsl = useSsl;
this.verifyMode = verifyMode;
@@ -63,7 +63,7 @@ class DefaultLettuceClientConfiguration implements LettuceClientConfiguration {
this.redisCredentialsProviderFactory = Optional.ofNullable(redisCredentialsProviderFactory);
this.timeout = timeout;
this.shutdownTimeout = shutdownTimeout;
this.shutdownQuietPeriod = shutdownQuietPeriod != null ? shutdownQuietPeriod : shutdownTimeout;
this.shutdownQuietPeriod = shutdownQuietPeriod;
}
@Override

View File

@@ -185,7 +185,7 @@ public interface LettuceClientConfiguration {
@Nullable RedisCredentialsProviderFactory redisCredentialsProviderFactory;
Duration timeout = Duration.ofSeconds(RedisURI.DEFAULT_TIMEOUT);
Duration shutdownTimeout = Duration.ofMillis(100);
@Nullable Duration shutdownQuietPeriod;
Duration shutdownQuietPeriod = Duration.ZERO;
LettuceClientConfigurationBuilder() {}