Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6FD789EA5 for ; Tue, 29 May 2012 13:31:25 +0000 (UTC) Received: (qmail 34002 invoked by uid 500); 29 May 2012 13:31:25 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 33705 invoked by uid 500); 29 May 2012 13:31:24 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 33679 invoked by uid 99); 29 May 2012 13:31:23 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2012 13:31:23 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id D213A142837 for ; Tue, 29 May 2012 13:31:23 +0000 (UTC) Date: Tue, 29 May 2012 13:31:23 +0000 (UTC) From: "Glyn Normington (JIRA)" To: dev@felix.apache.org Message-ID: <331316511.10988.1338298283862.JavaMail.jiratomcat@issues-vm> In-Reply-To: <291765322.426.1296503788956.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (FELIX-2813) NPE in UpdateThread when updating a configuration right after ConfigurationAdmin service starts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-2813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13284808#comment-13284808 ] Glyn Normington commented on FELIX-2813: ---------------------------------------- I'm interesting in when this fix will be available for download. Is there a date for configadmin-1.4.0? > NPE in UpdateThread when updating a configuration right after ConfigurationAdmin service starts > ----------------------------------------------------------------------------------------------- > > Key: FELIX-2813 > URL: https://issues.apache.org/jira/browse/FELIX-2813 > Project: Felix > Issue Type: Bug > Components: Configuration Admin > Reporter: Marcel Offermans > Assignee: Felix Meschberger > Fix For: configadmin-1.4.0 > > > 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 codebase: > 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 'configurationAdminRegistration' > 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. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira