drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ve...@apache.org
Subject [1/2] drill git commit: DRILL-3046: Release data buffers when interrupt occurs in DataTunnel.sendRecordBatch
Date Wed, 13 May 2015 21:43:13 GMT
Repository: drill
Updated Branches:
  refs/heads/master 97a01b2c6 -> c04a8f9fe


DRILL-3046: Release data buffers when interrupt occurs in DataTunnel.sendRecordBatch


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

Branch: refs/heads/master
Commit: c04a8f9fe0973d07c99dd3a2e2ddb4fd8b295814
Parents: 0328c4c
Author: adeneche <adeneche@gmail.com>
Authored: Wed May 13 11:48:23 2015 -0700
Committer: vkorukanti <venki.korukanti@gmail.com>
Committed: Wed May 13 11:53:26 2015 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/drill/exec/rpc/data/DataTunnel.java    | 5 +++++
 .../org/apache/drill/exec/server/TestDrillbitResilience.java    | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/c04a8f9f/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataTunnel.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataTunnel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataTunnel.java
index 143020f..7a6477e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataTunnel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataTunnel.java
@@ -83,6 +83,11 @@ public class DataTunnel {
       sendingSemaphore.acquire();
       manager.runCommand(b);
     }catch(final InterruptedException e){
+      // Release the buffers first before informing the listener about the interrupt.
+      for(ByteBuf buffer : batch.getBuffers()) {
+        buffer.release();
+      }
+
       outcomeListener.interrupted(e);
 
       // Preserve evidence that the interruption occurred so that code higher up on the call
stack can learn of the

http://git-wip-us.apache.org/repos/asf/drill/blob/c04a8f9f/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java
index 3efb629..f95fbe1 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestDrillbitResilience.java
@@ -77,9 +77,11 @@ import org.apache.drill.exec.work.foreman.Foreman;
 import org.apache.drill.exec.work.foreman.ForemanException;
 import org.apache.drill.exec.work.foreman.ForemanSetupException;
 import org.apache.drill.exec.work.fragment.FragmentExecutor;
+import org.apache.drill.test.DrillTest;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 
@@ -88,7 +90,7 @@ import org.slf4j.Logger;
  * execution by injecting exceptions at various points and to cancellations in various phases.
  * The test cases are mentioned in DRILL-2383.
  */
-public class TestDrillbitResilience {
+public class TestDrillbitResilience extends DrillTest {
   private static final Logger logger = org.slf4j.LoggerFactory.getLogger(TestDrillbitResilience.class);
 
   private static ZookeeperHelper zkHelper;
@@ -593,6 +595,7 @@ public class TestDrillbitResilience {
   }
 
   @Test // Cancellation TC 1: cancel before any result set is returned
+  @Ignore // DRILL-3052
   public void cancelBeforeAnyResultsArrive() {
     final WaitUntilCompleteListener listener = new WaitUntilCompleteListener() {
 


Mime
View raw message