You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2018/12/09 07:31:22 UTC

[GitHub] amansinha100 closed pull request #1565: DRILL-6874: Close input stream after AsyncPageReaderTask is completed

amansinha100 closed pull request #1565: DRILL-6874: Close input stream after AsyncPageReaderTask is completed
URL: https://github.com/apache/drill/pull/1565
 
 
   

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/store/parquet/columnreaders/AsyncPageReader.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/AsyncPageReader.java
index e429fb63a7c..8b5c926186b 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/AsyncPageReader.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/AsyncPageReader.java
@@ -417,6 +417,13 @@ public Void call() throws IOException {
       if (totalValuesRead >= totalValuesCount) {
         try {
           queue.put(ReadStatus.EMPTY);
+          // Some InputStreams (like S3ObjectInputStream) should be closed
+          // as soon as possible to make the connection reusable.
+          try {
+            parent.inputStream.close();
+          } catch (IOException e) {
+            logger.trace(String.format("[%s]: Failure while closing InputStream", name), e);
+          }
         } catch (InterruptedException e) {
           Thread.currentThread().interrupt();
           // Do nothing.


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services