[ 
https://issues.apache.org/jira/browse/DRILL-5156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16498388#comment-16498388
 ] 

ASF GitHub Bot commented on DRILL-5156:
---------------------------------------

paul-rogers closed pull request #709: DRILL-5156: BootStrapContext should close 
threads
URL: https://github.com/apache/drill/pull/709
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/server/BootStrapContext.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/server/BootStrapContext.java
index c498185046..dc0a392ba1 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/server/BootStrapContext.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/server/BootStrapContext.java
@@ -123,6 +123,16 @@ public ScanResult getClasspathScan() {
 
   @Override
   public void close() {
+    try {
+      loop2.shutdownGracefully(0, 0, TimeUnit.SECONDS);
+    } catch ( Exception e ) {
+      logger.warn("Failure During Bit-Client shutdown.", e);
+    }
+    try {
+      loop.shutdownGracefully(0, 0, TimeUnit.SECONDS);
+    } catch ( Exception e ) {
+      logger.warn("Failure During Bit-Server shutdown.", e);
+    }
     try {
       DrillMetrics.resetMetrics();
     } catch (Error | Exception e) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Bit-Client thread finds closed allocator in TestDrillbitResilience unit test
> ----------------------------------------------------------------------------
>
>                 Key: DRILL-5156
>                 URL: https://issues.apache.org/jira/browse/DRILL-5156
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>
> RPC thread attempts to access a closed allocator during the 
> {{TestDrillbitResilience}} unit test.
> Set a Java exception breakpoint for {{IllegalStateException}}. Run the 
> {{TestDrillbitResilience}} unit tests.
> You will see quite a few exceptions, including the following in a thread 
> called BitClient-1:
> {code}
> RootAllocator(BaseAllocator).assertOpen() line 109
> RootAllocator(BaseAllocator).buffer(int) line 191
> DrillByteBufAllocator.buffer(int) line 49
> DrillByteBufAllocator.ioBuffer(int) line 64
> AdaptiveRecvByteBufAllocatpr$HandleImpl.allocate(ByteBufAllocator) line 104
> NioSocketChannel$NioSocketChannelUnsafe(...).read() line 117
> ...
> NioEventLoop.run() line 354
> {code}
> The test continues (then fails for some other reason), which is why this is 
> marked as minor. Still, it seems odd that the client thread should attempt to 
> access a closed allocator.
> At this point, it is not clear how we got into this state. The test itself is 
> waiting for a response from the server in the {{tailsAfterMSorterSorting}} 
> test.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to