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/06 20:01:13 UTC

[GitHub] dvjyothsna commented on a change in pull request #1560: DRILL-6877: NPE when starting Drillbit

dvjyothsna commented on a change in pull request #1560: DRILL-6877: NPE when starting Drillbit
URL: https://github.com/apache/drill/pull/1560#discussion_r239594503
 
 

 ##########
 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 = Paths.get(drillHome);
 
 Review comment:
   @arina-ielchiieva 
   1. Added try-catch block while getting the drillHome path. What do you mean by if it is not set correctly? Both script and the code access the same variable and create or look for the graceful file.
   2. Updated the PR.
   3. Added java doc.
   
   

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