Skip to content

Commit

Permalink
Remove quiet time and decrease shutdown timeout to 2 seconds #613
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Sep 28, 2017
1 parent 0424bf8 commit 0534e2b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Expand Up @@ -600,6 +600,7 @@ Enhancements
* Enhance argument caching #575
* Introduce MethodTranslator caching #580
* Execute RedisAdvancedClusterCommands.scriptLoad(…) on all nodes #590
* Reduce default shutdown timeout #613
Fixes
-----
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/lettuce/core/AbstractRedisClient.java
Expand Up @@ -312,10 +312,10 @@ protected <K, V, T extends RedisChannelHandler<K, V>> ConnectionFuture<T> initia

/**
* Shutdown this client and close all open connections. The client should be discarded after calling shutdown. The shutdown
* has 2 secs quiet time and a timeout of 15 secs.
* has no quiet time and a timeout of 2 seconds.
*/
public void shutdown() {
shutdown(2, 15, TimeUnit.SECONDS);
shutdown(0, 2, TimeUnit.SECONDS);
}

/**
Expand Down
Expand Up @@ -478,7 +478,7 @@ protected void finalize() throws Throwable {
*/
@Override
public Future<Boolean> shutdown() {
return shutdown(2, 15, TimeUnit.SECONDS);
return shutdown(0, 2, TimeUnit.SECONDS);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/io/lettuce/core/FastShutdown.java
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2016 the original author or authors.
* Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,7 +30,7 @@ public class FastShutdown {
* @param redisClient
*/
public static void shutdown(AbstractRedisClient redisClient) {
redisClient.shutdown(10, 10, TimeUnit.MILLISECONDS);
redisClient.shutdown(0, 10, TimeUnit.MILLISECONDS);
}

/**
Expand All @@ -39,6 +39,6 @@ public static void shutdown(AbstractRedisClient redisClient) {
* @param clientResources
*/
public static void shutdown(ClientResources clientResources) {
clientResources.shutdown(10, 10, TimeUnit.MILLISECONDS);
clientResources.shutdown(0, 10, TimeUnit.MILLISECONDS);
}
}

0 comments on commit 0534e2b

Please sign in to comment.