[jboss-jira] [JBoss JIRA] (WFCORE-1855) Possible NPE on controller service start

David Lloyd (JIRA) issues at jboss.org
Wed Oct 5 09:37:00 EDT 2016


David Lloyd created WFCORE-1855:
-----------------------------------

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


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
(v6.4.11#64026)


More information about the jboss-jira mailing list