[jboss-jira] [JBoss JIRA] (WFCORE-1855) Possible NPE on controller service start
Brian Stansberry (JIRA)
issues at jboss.org
Wed Feb 1 13:50:00 EST 2017
[ https://issues.jboss.org/browse/WFCORE-1855?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brian Stansberry reassigned WFCORE-1855:
----------------------------------------
Assignee: Brian Stansberry
> Possible NPE on controller service start
> ----------------------------------------
>
> Key: WFCORE-1855
> URL: https://issues.jboss.org/browse/WFCORE-1855
> Project: WildFly Core
> Issue Type: Bug
> Reporter: David Lloyd
> Assignee: Brian Stansberry
>
> In {{org.jboss.as.controller.AbstractControllerService}}, the {{start}} method starts up a background thread which performs a certain amount of the boot process. Before this thread is started, a volatile field {{controller}} is initialized with the controller reported by the {{start()}} method.
> Inside this thread, some work is performed, and at the end of a certain amount of work, the {{finishBoot()}} method is invoked. This method calls {{controller.finishBoot()}}, referencing the field that was set in the {{start()}} method.
> The problem arises when the service itself is stopped before the boot thread completes. This causes the {{controller}} field to be nulled out, resulting in an NPE.
> I think we need to look at:
> * Why are we using a background thread for this?
> * Why are we _not_ using the asynchronous startup feature?
> I think we must do one of these two things in order to make this code "safe".
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list