[ https://issues.apache.org/jira/browse/DRILL-6591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16543806#comment-16543806 ]
ASF GitHub Bot commented on DRILL-6591: --------------------------------------- sohami closed pull request #1379: DRILL-6591: Show Exception for failed queries submitted in WebUI URL: https://github.com/apache/drill/pull/1379 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/rest/QueryWrapper.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java index cf749371034..1dac0db705f 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java @@ -22,6 +22,7 @@ import com.google.common.collect.Maps; import org.apache.drill.common.exceptions.UserException; +import org.apache.drill.common.exceptions.UserRemoteException; import org.apache.drill.exec.proto.UserBitShared.QueryId; import org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState; import org.apache.drill.exec.proto.UserBitShared.QueryType; @@ -86,9 +87,8 @@ public QueryResult run(final WorkManager workManager, final WebUserConnection we logger.debug("Wait until the query execution is complete or there is error submitting the query"); do { try { - isComplete = webUserConnection.await(TimeUnit.SECONDS.toMillis(1)); /*periodically timeout to check heap*/ - } catch (Exception e) { } - + isComplete = webUserConnection.await(TimeUnit.SECONDS.toMillis(1)); //periodically timeout 1 sec to check heap + } catch (InterruptedException e) {} usagePercent = getHeapUsage(); if (usagePercent > HEAP_MEMORY_FAILURE_THRESHOLD) { nearlyOutOfHeapSpace = true; @@ -97,21 +97,22 @@ public QueryResult run(final WorkManager workManager, final WebUserConnection we //Fail if nearly out of heap space if (nearlyOutOfHeapSpace) { + UserException almostOutOfHeapException = UserException.resourceError() + .message("There is not enough heap memory to run this query using the web interface. ") + .addContext("Please try a query with fewer columns or with a filter or limit condition to limit the data returned. ") + .addContext("You can also try an ODBC/JDBC client. ") + .build(logger); + //Add event workManager.getBee().getForemanForQueryId(queryId) - .addToEventQueue(QueryState.FAILED, - UserException.resourceError( - new Throwable( - "There is not enough heap memory to run this query using the web interface. " - + "Please try a query with fewer columns or with a filter or limit condition to limit the data returned. " - + "You can also try an ODBC/JDBC client. " - ) - ) - .build(logger) - ); + .addToEventQueue(QueryState.FAILED, almostOutOfHeapException); + //Return NearlyOutOfHeap exception + throw almostOutOfHeapException; } - if (logger.isTraceEnabled()) { - logger.trace("Query {} is completed ", queryId); + logger.trace("Query {} is completed ", queryId); + + if (webUserConnection.getError() != null) { + throw new UserRemoteException(webUserConnection.getError()); } if (webUserConnection.results.isEmpty()) { ---------------------------------------------------------------- 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 > When query fails on Web UI, result page does not show any error > --------------------------------------------------------------- > > Key: DRILL-6591 > URL: https://issues.apache.org/jira/browse/DRILL-6591 > Project: Apache Drill > Issue Type: Bug > Affects Versions: 1.13.0 > Reporter: Arina Ielchiieva > Assignee: Kunal Khatua > Priority: Major > Labels: ready-to-commit > Fix For: 1.14.0 > > Attachments: no_result_found.JPG > > > When query fails on Web UI result page no error is shown, only "No result > found." Screenshot attached. Drill should display error message instead. -- This message was sent by Atlassian JIRA (v7.6.3#76005)