felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1782501 - in /felix/trunk/jaas/src: main/java/org/apache/felix/jaas/internal/ConfigSpiOsgi.java test/java/org/apache/felix/jaas/internal/ITConcurrentLoginModuleFactoryTest.java
Date Fri, 10 Feb 2017 18:51:50 GMT
Author: chetanm
Date: Fri Feb 10 18:51:50 2017
New Revision: 1782501

URL: http://svn.apache.org/viewvc?rev=1782501&view=rev
Log:
FELIX-5536 - ConfigSpiOSGi may end with incomplete realm due to race conditions

Ensure that recreateConfigs is called within lock

Modified:
    felix/trunk/jaas/src/main/java/org/apache/felix/jaas/internal/ConfigSpiOsgi.java
    felix/trunk/jaas/src/test/java/org/apache/felix/jaas/internal/ITConcurrentLoginModuleFactoryTest.java

Modified: felix/trunk/jaas/src/main/java/org/apache/felix/jaas/internal/ConfigSpiOsgi.java
URL: http://svn.apache.org/viewvc/felix/trunk/jaas/src/main/java/org/apache/felix/jaas/internal/ConfigSpiOsgi.java?rev=1782501&r1=1782500&r2=1782501&view=diff
==============================================================================
--- felix/trunk/jaas/src/main/java/org/apache/felix/jaas/internal/ConfigSpiOsgi.java (original)
+++ felix/trunk/jaas/src/main/java/org/apache/felix/jaas/internal/ConfigSpiOsgi.java Fri Feb
10 18:51:50 2017
@@ -270,8 +270,11 @@ public class ConfigSpiOsgi extends Confi
 
         if (!newDefaultRealmName.equals(defaultRealmName))
         {
-            defaultRealmName = newDefaultRealmName;
-            recreateConfigs();
+            synchronized (lock)
+            {
+                defaultRealmName = newDefaultRealmName;
+                recreateConfigs();
+            }
         }
 
         String newProviderName = PropertiesUtil.toString(properties.get(JAAS_CONFIG_PROVIDER_NAME),

Modified: felix/trunk/jaas/src/test/java/org/apache/felix/jaas/internal/ITConcurrentLoginModuleFactoryTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/jaas/src/test/java/org/apache/felix/jaas/internal/ITConcurrentLoginModuleFactoryTest.java?rev=1782501&r1=1782500&r2=1782501&view=diff
==============================================================================
--- felix/trunk/jaas/src/test/java/org/apache/felix/jaas/internal/ITConcurrentLoginModuleFactoryTest.java
(original)
+++ felix/trunk/jaas/src/test/java/org/apache/felix/jaas/internal/ITConcurrentLoginModuleFactoryTest.java
Fri Feb 10 18:51:50 2017
@@ -53,7 +53,6 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.cm.ConfigurationException;
 
-@Ignore("FELIX-5536")
 @RunWith(Parameterized.class)
 public class ITConcurrentLoginModuleFactoryTest
 {



Mime
View raw message