sohami commented on a change in pull request #1560: DRILL-6877: NPE when 
starting Drill on Windows
URL: https://github.com/apache/drill/pull/1560#discussion_r238793517
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
 ##########
 @@ -374,17 +374,22 @@ public void run () {
     }
 
     private void pollShutdown(Drillbit drillbit) throws IOException, 
InterruptedException {
-      final Path drillPidDirPath = 
FileSystems.getDefault().getPath(System.getenv("DRILL_PID_DIR"));
-      final String gracefulFileName = System.getenv("GRACEFUL_SIGFILE");
+      final String drillHome = System.getenv("DRILL_HOME");
+      final String gracefulFile = System.getenv("GRACEFUL_SIGFILE");
+      if (drillHome == null || gracefulFile == null) {
+        logger.warn("Cannot access graceful file. Graceful shutdown from 
command line will not be supported.");
+        return;
+      }
+      final Path drillHomePath = FileSystems.getDefault().getPath(drillHome);
 
 Review comment:
   The defaultFileSystem is chosen either by 
`java.nio.file.spi.DefaultFileSystemProvider` system property or system-default 
one which is created 
[here](https://github.com/frohoff/jdk8u-jdk/blob/master/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java#L57)
 based on local filesystem
   As far as DistributedFileSystem is concerned I don't see it provides any 
constructor with a provider which NIO Filesystem expects and hence will fail in 
that case. So the api should only be good for local filesystem.
   Do we expect Drill binaries (not data) to be installed on Distributed 
FileSystem as well ? If yes then this will not work and might throw 
`RuntimeException`. May be we should catch and log warning in case of error on 
this thread instead of throwing RuntimeException.

----------------------------------------------------------------
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


With regards,
Apache Git Services

Reply via email to