From 85ed48a1d9ac5aafb2a914a05ef6a620eeec5d0d Mon Sep 17 00:00:00 2001 From: Alex Petrov Date: Tue, 13 Sep 2016 09:49:02 +0200 Subject: [PATCH] Backport CASSANDRA-10756 (race condition in NativeTransportService shutdown) Patch by Alex Petrov; reviewed by Joel Knighton for CASSANDRA-12472 --- CHANGES.txt | 4 ++++ .../cassandra/service/NativeTransportService.java | 11 +---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index f0ec3e33f4..5fd8e5e1b2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +3.0.10 + * Backport CASSANDRA-10756 (race condition in NativeTransportService shutdown) (CASSANDRA-12472) + + 3.0.9 * Handle composite prefixes with final EOC=0 as in 2.x and refactor LegacyLayout.decodeBound (CASSANDRA-12423) * Fix paging for 2.x to 3.x upgrades (CASSANDRA-11195) diff --git a/src/java/org/apache/cassandra/service/NativeTransportService.java b/src/java/org/apache/cassandra/service/NativeTransportService.java index eff3a8996f..48839f1cbb 100644 --- a/src/java/org/apache/cassandra/service/NativeTransportService.java +++ b/src/java/org/apache/cassandra/service/NativeTransportService.java @@ -145,16 +145,7 @@ public class NativeTransportService servers = Collections.emptyList(); // shutdown executors used by netty for native transport server - Future wgStop = workerGroup.shutdownGracefully(0, 0, TimeUnit.SECONDS); - - try - { - wgStop.await(5000); - } - catch (InterruptedException e1) - { - Thread.currentThread().interrupt(); - } + workerGroup.shutdownGracefully(3, 5, TimeUnit.SECONDS).awaitUninterruptibly(); // shutdownGracefully not implemented yet in RequestThreadPoolExecutor eventExecutorGroup.shutdown();