Skip to content

Commit

Permalink
Stop the HashedWheelTimer before shutting down EventLoopGroups #123
Browse files Browse the repository at this point in the history
Motivation: Active timer tasks can request interaction with a EventLoopGroup that is signalled for shutdown. Tasks in that state are likely to fail and cause exceptions which are logged.

Result: The timer is stopped before the EventLoopGroups are shut down so there are no more active timer tasks when the EventLoops are stopped
  • Loading branch information
mp911de committed Aug 26, 2015
1 parent 949964f commit e5817a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Fixes
-----
* Synchronization/cross thread visibility of variables #94
* Check channel state before calling Channel.close.syncUninterruptibly #113
* Stop the HashedWheelTimer before shutting down EventLoopGroups #123

Other
------
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/lambdaworks/redis/AbstractRedisClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ public void shutdown() {
*/
public void shutdown(long quietPeriod, long timeout, TimeUnit timeUnit) {

timer.stop();

while (!closeableResources.isEmpty()) {
Closeable closeableResource = closeableResources.iterator().next();
try {
Expand Down Expand Up @@ -296,8 +298,6 @@ public void shutdown(long quietPeriod, long timeout, TimeUnit timeUnit) {
throw new RedisException(e);
}
}

timer.stop();
}

protected int getResourceCount() {
Expand Down

0 comments on commit e5817a4

Please sign in to comment.