[ 
https://issues.apache.org/jira/browse/DRILL-4508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15193734#comment-15193734
 ] 

Venki Korukanti commented on DRILL-4508:
----------------------------------------

We need it in the implementation of AutoCloseable.close(). 

> Null proof all AutoCloseable.close() methods
> --------------------------------------------
>
>                 Key: DRILL-4508
>                 URL: https://issues.apache.org/jira/browse/DRILL-4508
>             Project: Apache Drill
>          Issue Type: Bug
>          Components:  Server
>    Affects Versions: 1.5.0
>            Reporter: Venki Korukanti
>            Priority: Minor
>             Fix For: 1.7.0
>
>
> 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:
> {code}
> 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]
> {code}
> This masks the actual error (incorrect configuration) and it is hard to know 
> what went wrong.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to