[jboss-jira] [JBoss JIRA] (AS7-4402) FilePersistentObjectStore establishDirectory() is not thead safe
Brian Stansberry (JIRA)
jira-events at lists.jboss.org
Wed Apr 4 13:51:47 EDT 2012
[ https://issues.jboss.org/browse/AS7-4402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brian Stansberry resolved AS7-4402.
-----------------------------------
Resolution: Done
> FilePersistentObjectStore establishDirectory() is not thead safe
> ----------------------------------------------------------------
>
> Key: AS7-4402
> URL: https://issues.jboss.org/browse/AS7-4402
> Project: Application Server 7
> Issue Type: Bug
> Components: EJB
> Reporter: Brian Stansberry
> Assignee: Brian Stansberry
> Fix For: 7.1.2.Final-redhat1
>
>
> FilePersistentObjectStore.start() can be called concurrently (perhaps on different instances) as different SFSB component services concurrently start. This can lead to races where multiple threads detect a dir does not exist and call File.mkdirs(), with only one getting a "true" return value from that call (the thread that actually created the dirs). When that happens the other thread(s) can fail like this:
> 15:35:01,170 ERROR org.jboss.msc.service.fail MSC00001: Failed to start service jboss.deployment.unit."persistentcontext-test.jar".component.StatefulTransientBean.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."persistentcontext-test.jar".component.StatefulTransientBean.START: Failed to start service
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_29]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_29]
> at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29]
> Caused by: java.lang.RuntimeException: JBAS014540: Failed to create passivation directory: /home/bstansberry/dev/jboss/jboss-as/testsuite/integration/basic/target/jbossas/standalone/data/ejb3/sessions
> at org.jboss.as.ejb3.cache.spi.impl.FilePersistentObjectStore.establishDirectory(FilePersistentObjectStore.java:212)
> at org.jboss.as.ejb3.cache.spi.impl.FilePersistentObjectStore.start(FilePersistentObjectStore.java:197)
> at org.jboss.as.ejb3.cache.impl.backing.SimpleBackingCacheEntryStore.start(SimpleBackingCacheEntryStore.java:191)
> at org.jboss.as.ejb3.cache.impl.backing.SerializationGroupMemberContainer.start(SerializationGroupMemberContainer.java:303)
> at org.jboss.as.ejb3.cache.impl.backing.PassivatingBackingCacheImpl.start(PassivatingBackingCacheImpl.java:297)
> at org.jboss.as.ejb3.cache.spi.impl.AbstractCache.start(AbstractCache.java:93)
> at org.jboss.as.ejb3.component.stateful.StatefulSessionComponent.start(StatefulSessionComponent.java:299)
> at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
> ... 3 more
> Solution is to just not throw that exception if the directory exists following the mkdirs() call, whether or not the call returned true.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list