felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FELIX-2813) NPE in UpdateThread when updating a configuration right after ConfigurationAdmin service starts
Date Tue, 01 Feb 2011 12:40:29 GMT

    [ https://issues.apache.org/jira/browse/FELIX-2813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12989180#comment-12989180

Felix Meschberger commented on FELIX-2813:

Yes, the ConfigurationEvent is actually generated immediately before sending it out. So just
enqueuing the task to send the event is save.

> NPE in UpdateThread when updating a configuration right after ConfigurationAdmin service
> -----------------------------------------------------------------------------------------------
>                 Key: FELIX-2813
>                 URL: https://issues.apache.org/jira/browse/FELIX-2813
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>            Reporter: Marcel Offermans
> When you:
> 1) register as a configuration listener
> 2) wait for the ConfigurationAdmin service to start
> 3) upon start, immediately create a new configuration and update its properties
> You (sometimes) get a NPE in the UpdateThread because there is a race condition in the
> a) ConfigurationManager.java:1818 will invoke getServiceReference() which uses the service
registration to get to the reference
> b) ConfigurationManager.java:242 registers the service and assigns the registration to
> First of all, the call to registerService in line 242 will already trigger service listeners
and trackers to invoke callbacks before this call returns, so 'configurationAdminRegistration'
will still be null. Furthermore, there is no synchronization, the member is not volatile,
so we need to make sure this value is really written before any configuration events are created
under a) (now the thread doing that is started way before the service is registered).
> I will commit a test that shows the exception, but since it happens in a thread I cannot
"catch" it won't show up as a failed test.

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message