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 2022/09/07 08:58:11 UTC

[GitHub] [drill] jnturton opened a new pull request, #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

jnturton opened a new pull request, #2641:
URL: https://github.com/apache/drill/pull/2641

   # [DRILL-8295](https://issues.apache.org/jira/browse/DRILL-8295): Probable resource leak in the HTTP storage plugin
   
   ## Description
   
   Adds close() calls in a number of places where HTTP requests are made in the HTTP storage plugin.
   
   ## Documentation
   N/A
   
   ## Testing
   Existing unit tests.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [drill] jnturton commented on a diff in pull request #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

Posted by GitBox <gi...@apache.org>.
jnturton commented on code in PR #2641:
URL: https://github.com/apache/drill/pull/2641#discussion_r964935897


##########
contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/udfs/HttpHelperFunctions.java:
##########
@@ -189,6 +191,8 @@ public void eval() {
         rowWriter.start();
         if (jsonLoader.parser().next()) {
           rowWriter.save();
+        } else {

Review Comment:
   @cgivre yes, you're right. I tried a couple of things. First I provided a JSON response that would normally produce 64k+1 rows if queried to http_get but it looked to me like it was being handled in a single batch since, I guess, the row count of a query based on VALUES(1) is still 1. I then wrote a query to `SELECT http_get(some simple JSON)` from a mock table containing 64k+1 rows. This overwhelms the okhttp3 mock server and fails with a timeout. I'm not sure if there some other test to try here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [drill] jnturton commented on a diff in pull request #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

Posted by GitBox <gi...@apache.org>.
jnturton commented on code in PR #2641:
URL: https://github.com/apache/drill/pull/2641#discussion_r965517773


##########
contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/udfs/HttpHelperFunctions.java:
##########
@@ -189,6 +191,8 @@ public void eval() {
         rowWriter.start();
         if (jsonLoader.parser().next()) {
           rowWriter.save();
+        } else {

Review Comment:
   I fed the http_get function a string containing 50 million little JSON objects from sequence {"foo": 1} {"foo": 2} {"foo": 3}... and it got through it (took about 45s). I just don't know if that answers the right question.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [drill] cgivre commented on a diff in pull request #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

Posted by GitBox <gi...@apache.org>.
cgivre commented on code in PR #2641:
URL: https://github.com/apache/drill/pull/2641#discussion_r964729134


##########
contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/udfs/HttpHelperFunctions.java:
##########
@@ -189,6 +191,8 @@ public void eval() {
         rowWriter.start();
         if (jsonLoader.parser().next()) {
           rowWriter.save();
+        } else {

Review Comment:
   Should we explicitly close the `results` `InputStream` here as well?  Would mind testing this on a query that produces multiple batches?  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [drill] cgivre commented on a diff in pull request #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

Posted by GitBox <gi...@apache.org>.
cgivre commented on code in PR #2641:
URL: https://github.com/apache/drill/pull/2641#discussion_r964788631


##########
contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/udfs/HttpHelperFunctions.java:
##########
@@ -189,6 +191,8 @@ public void eval() {
         rowWriter.start();
         if (jsonLoader.parser().next()) {
           rowWriter.save();
+        } else {

Review Comment:
   From my recollection, this function does handle the multiple batches.  It was the `convert_fromJSON` that @vdiravka was working on.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [drill] cgivre commented on a diff in pull request #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

Posted by GitBox <gi...@apache.org>.
cgivre commented on code in PR #2641:
URL: https://github.com/apache/drill/pull/2641#discussion_r965897296


##########
contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/udfs/HttpHelperFunctions.java:
##########
@@ -189,6 +191,8 @@ public void eval() {
         rowWriter.start();
         if (jsonLoader.parser().next()) {
           rowWriter.save();
+        } else {

Review Comment:
   That works for me :-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [drill] jnturton commented on a diff in pull request #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

Posted by GitBox <gi...@apache.org>.
jnturton commented on code in PR #2641:
URL: https://github.com/apache/drill/pull/2641#discussion_r964747549


##########
contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/udfs/HttpHelperFunctions.java:
##########
@@ -189,6 +191,8 @@ public void eval() {
         rowWriter.start();
         if (jsonLoader.parser().next()) {
           rowWriter.save();
+        } else {

Review Comment:
   @cgivre
   
   1. The JsonLoader closes the input streams it's been working off of when it is closed so I don't think so.
   2. Multiple batch datasets do not work with these UDFs yet from what I recall? I think @vdiravka continues to work on that, perhaps he can comment on the closing of the JsonLoader here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [drill] cgivre merged pull request #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

Posted by GitBox <gi...@apache.org>.
cgivre merged PR #2641:
URL: https://github.com/apache/drill/pull/2641


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [drill] pjfanning commented on pull request #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

Posted by GitBox <gi...@apache.org>.
pjfanning commented on PR #2641:
URL: https://github.com/apache/drill/pull/2641#issuecomment-1239212973

   @jnturton there are also similar issues in
   * org.apache.drill.exec.store.http.util.SimpleHttp
   * org.apache.drill.exec.store.http.oauth.OAuthUtils


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [drill] jnturton commented on pull request #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

Posted by GitBox <gi...@apache.org>.
jnturton commented on PR #2641:
URL: https://github.com/apache/drill/pull/2641#issuecomment-1239237242

   > @jnturton there are also similar issues in
   > 
   >     * org.apache.drill.exec.store.http.util.SimpleHttp
   > 
   >     * org.apache.drill.exec.store.http.oauth.OAuthUtils
   
   @pjfanning thanks I picked up a couple of extra instances.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [drill] jnturton commented on a diff in pull request #2641: DRILL-8295: Probable resource leak in the HTTP storage plugin

Posted by GitBox <gi...@apache.org>.
jnturton commented on code in PR #2641:
URL: https://github.com/apache/drill/pull/2641#discussion_r964935897


##########
contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/udfs/HttpHelperFunctions.java:
##########
@@ -189,6 +191,8 @@ public void eval() {
         rowWriter.start();
         if (jsonLoader.parser().next()) {
           rowWriter.save();
+        } else {

Review Comment:
   @cgivre yes, you're right. I tried a couple of things. First I provided a JSON response that would normally produce 64k+1 rows if queried to http_get but it looked to me like it was being handled in a single batch since, I guess, the row count of the query is still 1. I then wrote a query to `SELECT http_get(some simple JSON)` from a mock table containing 64k+1 rows. This overwhelms the okhttp3 mock server and fails with a timeout. I'm not sure if there some other test to try here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org