Backport CASSANDRA-10756 (race condition in NativeTransportService shutdown)

Patch by Alex Petrov; reviewed by Joel Knighton for CASSANDRA-12472


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/85ed48a1
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/85ed48a1
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/85ed48a1

Branch: refs/heads/trunk
Commit: 85ed48a1d9ac5aafb2a914a05ef6a620eeec5d0d
Parents: d600f51
Author: Alex Petrov <oleksandr.pet...@gmail.com>
Authored: Tue Sep 13 09:49:02 2016 +0200
Committer: Aleksey Yeschenko <alek...@apache.org>
Committed: Mon Sep 19 16:41:57 2016 -0700

----------------------------------------------------------------------
 CHANGES.txt                                              |  4 ++++
 .../apache/cassandra/service/NativeTransportService.java | 11 +----------
 2 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/85ed48a1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f0ec3e3..5fd8e5e 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)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/85ed48a1/src/java/org/apache/cassandra/service/NativeTransportService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/NativeTransportService.java 
b/src/java/org/apache/cassandra/service/NativeTransportService.java
index eff3a89..48839f1 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();

Reply via email to