DATAREDIS-656 - Reduce default LettuceConnectionFactory shutdown timeout to 100ms.
Reducing the default to 100 milliseconds is a good compromise to retain a quiet time in for parallel execution and optimize for default, single-threaded execution (such as test execution or regular application shutdown). The shutdown timeout can be adjusted to fit specific application needs. Previously, LettuceConnectionFactory used different defaults: 2 seconds if used LettuceClientConfiguration and 60 seconds without LettuceClientConfiguration. In any case, defaults delay shutdown and cause severe delays in total. The driver default of two seconds provides enough time to complete long-running tasks before the actual thread pool shutdown. Original Pull Request: #251
This commit is contained in:
committed by
Christoph Strobl
parent
475d1bbf41
commit
3185173805
@@ -223,11 +223,11 @@ public interface LettuceClientConfiguration {
|
||||
private ClientResources clientResources;
|
||||
private ClientOptions clientOptions;
|
||||
private Duration timeout = Duration.ofSeconds(RedisURI.DEFAULT_TIMEOUT);
|
||||
private Duration shutdownTimeout = Duration.ofSeconds(2);
|
||||
private Duration shutdownTimeout = Duration.ofMillis(100);
|
||||
|
||||
private DefaultLettuceClientConfigurationBuilder() {}
|
||||
|
||||
/*d
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder#useSsl()
|
||||
*/
|
||||
@@ -239,7 +239,7 @@ public interface LettuceClientConfiguration {
|
||||
}
|
||||
|
||||
/*
|
||||
*(non-Javadoc)
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceSslClientConfigurationBuilder#disablePeerVerification()
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -851,7 +851,7 @@ public class LettuceConnectionFactory
|
||||
private boolean startTls;
|
||||
private ClientResources clientResources;
|
||||
private Duration timeout = Duration.ofSeconds(RedisURI.DEFAULT_TIMEOUT);
|
||||
private Duration shutdownTimeout = Duration.ofSeconds(RedisURI.DEFAULT_TIMEOUT);
|
||||
private Duration shutdownTimeout = Duration.ofMillis(100);
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration#isUseSsl()
|
||||
|
||||
Reference in New Issue
Block a user