Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4508

Null proof all AutoCloseable.close() methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.5.0
    • Future
    • Server
    • None

    Description

      If Drillbit fails to start (due to incorrect configuration or storage plugin information not found etc.), we end up calling close on various components such as WebServer, Drillbit etc. Some of these components may not have initialized and may have null values. Close() method is not checking for null values before reading them. One example is here:

      java.lang.NullPointerException: null
              at org.apache.drill.exec.server.options.SystemOptionManager.close(SystemOptionManager.java:280) ~[drill-java-exec-1.6.0.jar:1.6.0]
              at org.apache.drill.exec.server.DrillbitContext.close(DrillbitContext.java:185) ~[drill-java-exec-1.6.0.jar:1.6.0]
              at org.apache.drill.exec.work.WorkManager.close(WorkManager.java:157) ~[drill-java-exec-1.6.0.jar:1.6.0]
              at org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:76) ~[drill-common-1.6.0.jar:1.6.0]
              at org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:64) ~[drill-common-1.6.0.jar:1.6.0]
              at org.apache.drill.exec.server.Drillbit.close(Drillbit.java:149) [drill-java-exec-1.6.0.jar:1.6.0]
              at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:283) [drill-java-exec-1.6.0.jar:1.6.0]
              at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:261) [drill-java-exec-1.6.0.jar:1.6.0]
              at org.apache.drill.exec.server.Drillbit.main(Drillbit.java:257) [drill-java-exec-1.6.0.jar:1.6.0]
      

      This masks the actual error (incorrect configuration) and it is hard to know what went wrong.

      Attachments

        Activity

          People

            Unassigned Unassigned
            vkorukanti Venki Korukanti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: