kkhatua commented on a change in pull request #1279: DRILL-5735: Allow
search/sort in the Options webUI
URL: https://github.com/apache/drill/pull/1279#discussion_r208779203
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebServer.java
##########
@@ -194,6 +220,16 @@ private ServletContextHandler
createServletContextHandler(final boolean authEnab
staticHolder.setInitParameter("pathInfoOnly", "true");
servletContextHandler.addServlet(staticHolder, "/static/*");
+ //Add Local path resource (This will allow access to dynamically created
files like JavaScript)
+ final ServletHolder dynamicHolder = new ServletHolder("dynamic",
DefaultServlet.class);
+ //Skip if unable to get a temp directory (e.g. during Unit tests)
+ if (getTmpJavaScriptDir() != null) {
Review comment:
@arina-ielchiieva I'm unable to reply to your comment on line 452, so doing
it here.
```
arina-ielchiieva on Jun 15 Contributor
I meant what if we fail to delete temp directory? May be use delete quietly.
```
The temp directory is already marked as `deleteOnExit()` , so the JVM should
also do that during shutdown. However, it didn't seem to work always, so an
explicit delete is fine.
```
arina-ielchiieva on Jun 15 Contributor
Again defending getTmpJavaScriptDir() usage is incorrect. Consider the case
when server start will fail before generating js temp dir, so in close method
you'll call getTmpJavaScriptDir() and it will generate js options since it did
not do it at start up since all we need is to delete the directory.
```
The creation of the JS options is a negligible cost, as long as we are
cleaning up correctly.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services