jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Wesdorp (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (JCR-3707) deadlock on calling login
Date Fri, 20 Dec 2013 10:30:10 GMT

     [ https://issues.apache.org/jira/browse/JCR-3707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Chris Wesdorp updated JCR-3707:
-------------------------------

    Description: 
In our scenario we often encounter deadlocks in JackRabbit when the repository is accessed
when using the RepositoryFactory. 

The code to get a connection as followed and can be executed concurrent in different threads.
{noformat}
Map<String, String> parameters = new HashMap<String, String>();
parameters.put(Constants.REPOSITORY_URI_PROPERTY, configuration.getRepositoryLocation());

Iterator<RepositoryFactory> iterator = ServiceRegistry
		.lookupProviders(RepositoryFactory.class);
while (iterator.hasNext()) {
	RepositoryFactory factory = iterator.next();

    repository = factory.getRepository(parameters);
    if (repository != null) {
		// We found the requested repository!
		break;
    }
}
{noformat}

Then from the JVisualVM the following thread dumps are taken. First the thread holding the
lock
{noformat}
"http-thread-pool-8080-(2)" - Thread t@92
   java.lang.Thread.State: WAITING on java.util.concurrent.locks.ReentrantLock$NonfairSync@19f1675
owned by: http-thread-pool-8080-(14)
	at sun.misc.Unsafe.park(Native Method)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
	at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
	at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:194)
	at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
	at org.apache.jackrabbit.core.ItemImpl.getPath(ItemImpl.java:376)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:821)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.internalGetAuthorizable(UserManagerImpl.java:908)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:478)
	at org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider.providePrincipal(DefaultPrincipalProvider.java:124)
	at org.apache.jackrabbit.core.security.principal.AbstractPrincipalProvider.getPrincipal(AbstractPrincipalProvider.java:112)
	- locked org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider@e4359f
	at org.apache.jackrabbit.core.security.simple.SimpleLoginModule.getPrincipal(SimpleLoginModule.java:95)
	at org.apache.jackrabbit.core.security.authentication.AbstractLoginModule.login(AbstractLoginModule.java:319)
	at org.apache.jackrabbit.core.security.authentication.LocalAuthContext.login(LocalAuthContext.java:86)
	at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1465)
	at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:135)
	at org.apache.jackrabbit.server.SessionProviderImpl.getSession(SessionProviderImpl.java:86)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.getRepositorySession(JCRWebdavServer.java:337)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.get(JCRWebdavServer.java:232)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.access$200(JCRWebdavServer.java:165)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer.attachSession(JCRWebdavServer.java:103)
	at org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.service(AbstractWebdavServlet.java:275)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
	at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:239)
	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
	at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:481)
	at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:342)
	at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
	at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
	at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
	at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
	at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
	at java.lang.Thread.run(Thread.java:619)

   Locked ownable synchronizers:
	- locked java.util.concurrent.locks.ReentrantLock$NonfairSync@1c4c77a
{noformat}

And secondly (one of) the thread that is stopped
{noformat}
"http-thread-pool-8080-(2)" - Thread t@92
   java.lang.Thread.State: WAITING on java.util.concurrent.locks.ReentrantLock$NonfairSync@19f1675
owned by: http-thread-pool-8080-(14)
	at sun.misc.Unsafe.park(Native Method)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
	at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
	at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:194)
	at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
	at org.apache.jackrabbit.core.ItemImpl.getPath(ItemImpl.java:376)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:821)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.internalGetAuthorizable(UserManagerImpl.java:908)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:478)
	at org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider.providePrincipal(DefaultPrincipalProvider.java:124)
	at org.apache.jackrabbit.core.security.principal.AbstractPrincipalProvider.getPrincipal(AbstractPrincipalProvider.java:112)
	- locked org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider@e4359f
	at org.apache.jackrabbit.core.security.simple.SimpleLoginModule.getPrincipal(SimpleLoginModule.java:95)
	at org.apache.jackrabbit.core.security.authentication.AbstractLoginModule.login(AbstractLoginModule.java:319)
	at org.apache.jackrabbit.core.security.authentication.LocalAuthContext.login(LocalAuthContext.java:86)
	at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1465)
	at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:135)
	at org.apache.jackrabbit.server.SessionProviderImpl.getSession(SessionProviderImpl.java:86)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.getRepositorySession(JCRWebdavServer.java:337)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.get(JCRWebdavServer.java:232)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.access$200(JCRWebdavServer.java:165)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer.attachSession(JCRWebdavServer.java:103)
	at org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.service(AbstractWebdavServlet.java:275)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
	at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:239)
	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
	at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:481)
	at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:342)
	at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
	at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
	at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
	at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
	at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
	at java.lang.Thread.run(Thread.java:619)

   Locked ownable synchronizers:
	- locked java.util.concurrent.locks.ReentrantLock$NonfairSync@1c4c77a
{noformat}

This happens mostly just after deployment of the jackrabbit repo. Once a single call is successfully
made the system keeps working.  

  was:
In our scenario we often encounter deadlocks in JackRabbit when the repository is accessed
when using the RepositoryFactory. 

The code to get a connection as followed and can be executed concurrent in different threads.
{{noformat}}
Map<String, String> parameters = new HashMap<String, String>();
parameters.put(Constants.REPOSITORY_URI_PROPERTY, configuration.getRepositoryLocation());

Iterator<RepositoryFactory> iterator = ServiceRegistry
		.lookupProviders(RepositoryFactory.class);
while (iterator.hasNext()) {
	RepositoryFactory factory = iterator.next();

    repository = factory.getRepository(parameters);
    if (repository != null) {
		// We found the requested repository!
		break;
    }
}
{{noformat}}

Then from the JVisualVM the following thread dumps are taken. First the thread holding the
lock
{noformat}
"http-thread-pool-8080-(2)" - Thread t@92
   java.lang.Thread.State: WAITING on java.util.concurrent.locks.ReentrantLock$NonfairSync@19f1675
owned by: http-thread-pool-8080-(14)
	at sun.misc.Unsafe.park(Native Method)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
	at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
	at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:194)
	at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
	at org.apache.jackrabbit.core.ItemImpl.getPath(ItemImpl.java:376)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:821)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.internalGetAuthorizable(UserManagerImpl.java:908)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:478)
	at org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider.providePrincipal(DefaultPrincipalProvider.java:124)
	at org.apache.jackrabbit.core.security.principal.AbstractPrincipalProvider.getPrincipal(AbstractPrincipalProvider.java:112)
	- locked org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider@e4359f
	at org.apache.jackrabbit.core.security.simple.SimpleLoginModule.getPrincipal(SimpleLoginModule.java:95)
	at org.apache.jackrabbit.core.security.authentication.AbstractLoginModule.login(AbstractLoginModule.java:319)
	at org.apache.jackrabbit.core.security.authentication.LocalAuthContext.login(LocalAuthContext.java:86)
	at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1465)
	at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:135)
	at org.apache.jackrabbit.server.SessionProviderImpl.getSession(SessionProviderImpl.java:86)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.getRepositorySession(JCRWebdavServer.java:337)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.get(JCRWebdavServer.java:232)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.access$200(JCRWebdavServer.java:165)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer.attachSession(JCRWebdavServer.java:103)
	at org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.service(AbstractWebdavServlet.java:275)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
	at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:239)
	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
	at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:481)
	at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:342)
	at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
	at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
	at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
	at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
	at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
	at java.lang.Thread.run(Thread.java:619)

   Locked ownable synchronizers:
	- locked java.util.concurrent.locks.ReentrantLock$NonfairSync@1c4c77a
{noformat}

And secondly (one of) the thread that is stopped
{noformat}
"http-thread-pool-8080-(2)" - Thread t@92
   java.lang.Thread.State: WAITING on java.util.concurrent.locks.ReentrantLock$NonfairSync@19f1675
owned by: http-thread-pool-8080-(14)
	at sun.misc.Unsafe.park(Native Method)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
	at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
	at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:194)
	at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
	at org.apache.jackrabbit.core.ItemImpl.getPath(ItemImpl.java:376)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:821)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.internalGetAuthorizable(UserManagerImpl.java:908)
	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:478)
	at org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider.providePrincipal(DefaultPrincipalProvider.java:124)
	at org.apache.jackrabbit.core.security.principal.AbstractPrincipalProvider.getPrincipal(AbstractPrincipalProvider.java:112)
	- locked org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider@e4359f
	at org.apache.jackrabbit.core.security.simple.SimpleLoginModule.getPrincipal(SimpleLoginModule.java:95)
	at org.apache.jackrabbit.core.security.authentication.AbstractLoginModule.login(AbstractLoginModule.java:319)
	at org.apache.jackrabbit.core.security.authentication.LocalAuthContext.login(LocalAuthContext.java:86)
	at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1465)
	at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:135)
	at org.apache.jackrabbit.server.SessionProviderImpl.getSession(SessionProviderImpl.java:86)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.getRepositorySession(JCRWebdavServer.java:337)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.get(JCRWebdavServer.java:232)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.access$200(JCRWebdavServer.java:165)
	at org.apache.jackrabbit.server.jcr.JCRWebdavServer.attachSession(JCRWebdavServer.java:103)
	at org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.service(AbstractWebdavServlet.java:275)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
	at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:239)
	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
	at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:481)
	at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:342)
	at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
	at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
	at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
	at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
	at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
	at java.lang.Thread.run(Thread.java:619)

   Locked ownable synchronizers:
	- locked java.util.concurrent.locks.ReentrantLock$NonfairSync@1c4c77a
{noformat}

This happens mostly just after deployment of the jackrabbit repo. Once a single call is successfully
made the system keeps working.  


> deadlock on calling login
> -------------------------
>
>                 Key: JCR-3707
>                 URL: https://issues.apache.org/jira/browse/JCR-3707
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.6.3
>         Environment: Glassfish 3.0.1
> Java 6
> 1x 3Ghz Processor
> Windows Server 2003 R2
>            Reporter: Chris Wesdorp
>
> In our scenario we often encounter deadlocks in JackRabbit when the repository is accessed
when using the RepositoryFactory. 
> The code to get a connection as followed and can be executed concurrent in different
threads.
> {noformat}
> Map<String, String> parameters = new HashMap<String, String>();
> parameters.put(Constants.REPOSITORY_URI_PROPERTY, configuration.getRepositoryLocation());
> Iterator<RepositoryFactory> iterator = ServiceRegistry
> 		.lookupProviders(RepositoryFactory.class);
> while (iterator.hasNext()) {
> 	RepositoryFactory factory = iterator.next();
>     repository = factory.getRepository(parameters);
>     if (repository != null) {
> 		// We found the requested repository!
> 		break;
>     }
> }
> {noformat}
> Then from the JVisualVM the following thread dumps are taken. First the thread holding
the lock
> {noformat}
> "http-thread-pool-8080-(2)" - Thread t@92
>    java.lang.Thread.State: WAITING on java.util.concurrent.locks.ReentrantLock$NonfairSync@19f1675
owned by: http-thread-pool-8080-(14)
> 	at sun.misc.Unsafe.park(Native Method)
> 	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
> 	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
> 	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
> 	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
> 	at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
> 	at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
> 	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:194)
> 	at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
> 	at org.apache.jackrabbit.core.ItemImpl.getPath(ItemImpl.java:376)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:821)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.internalGetAuthorizable(UserManagerImpl.java:908)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:478)
> 	at org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider.providePrincipal(DefaultPrincipalProvider.java:124)
> 	at org.apache.jackrabbit.core.security.principal.AbstractPrincipalProvider.getPrincipal(AbstractPrincipalProvider.java:112)
> 	- locked org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider@e4359f
> 	at org.apache.jackrabbit.core.security.simple.SimpleLoginModule.getPrincipal(SimpleLoginModule.java:95)
> 	at org.apache.jackrabbit.core.security.authentication.AbstractLoginModule.login(AbstractLoginModule.java:319)
> 	at org.apache.jackrabbit.core.security.authentication.LocalAuthContext.login(LocalAuthContext.java:86)
> 	at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1465)
> 	at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:135)
> 	at org.apache.jackrabbit.server.SessionProviderImpl.getSession(SessionProviderImpl.java:86)
> 	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.getRepositorySession(JCRWebdavServer.java:337)
> 	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.get(JCRWebdavServer.java:232)
> 	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.access$200(JCRWebdavServer.java:165)
> 	at org.apache.jackrabbit.server.jcr.JCRWebdavServer.attachSession(JCRWebdavServer.java:103)
> 	at org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.service(AbstractWebdavServlet.java:275)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
> 	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
> 	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
> 	at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
> 	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
> 	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:239)
> 	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
> 	at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:481)
> 	at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:342)
> 	at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
> 	at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
> 	at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
> 	at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
> 	at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
> 	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
> 	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
> 	at java.lang.Thread.run(Thread.java:619)
>    Locked ownable synchronizers:
> 	- locked java.util.concurrent.locks.ReentrantLock$NonfairSync@1c4c77a
> {noformat}
> And secondly (one of) the thread that is stopped
> {noformat}
> "http-thread-pool-8080-(2)" - Thread t@92
>    java.lang.Thread.State: WAITING on java.util.concurrent.locks.ReentrantLock$NonfairSync@19f1675
owned by: http-thread-pool-8080-(14)
> 	at sun.misc.Unsafe.park(Native Method)
> 	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
> 	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
> 	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
> 	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
> 	at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
> 	at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
> 	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:194)
> 	at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
> 	at org.apache.jackrabbit.core.ItemImpl.getPath(ItemImpl.java:376)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:821)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.internalGetAuthorizable(UserManagerImpl.java:908)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:478)
> 	at org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider.providePrincipal(DefaultPrincipalProvider.java:124)
> 	at org.apache.jackrabbit.core.security.principal.AbstractPrincipalProvider.getPrincipal(AbstractPrincipalProvider.java:112)
> 	- locked org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider@e4359f
> 	at org.apache.jackrabbit.core.security.simple.SimpleLoginModule.getPrincipal(SimpleLoginModule.java:95)
> 	at org.apache.jackrabbit.core.security.authentication.AbstractLoginModule.login(AbstractLoginModule.java:319)
> 	at org.apache.jackrabbit.core.security.authentication.LocalAuthContext.login(LocalAuthContext.java:86)
> 	at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1465)
> 	at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:135)
> 	at org.apache.jackrabbit.server.SessionProviderImpl.getSession(SessionProviderImpl.java:86)
> 	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.getRepositorySession(JCRWebdavServer.java:337)
> 	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.get(JCRWebdavServer.java:232)
> 	at org.apache.jackrabbit.server.jcr.JCRWebdavServer$SessionCache.access$200(JCRWebdavServer.java:165)
> 	at org.apache.jackrabbit.server.jcr.JCRWebdavServer.attachSession(JCRWebdavServer.java:103)
> 	at org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.service(AbstractWebdavServlet.java:275)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
> 	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
> 	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
> 	at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
> 	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
> 	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:239)
> 	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
> 	at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:481)
> 	at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:342)
> 	at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
> 	at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
> 	at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
> 	at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
> 	at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
> 	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
> 	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
> 	at java.lang.Thread.run(Thread.java:619)
>    Locked ownable synchronizers:
> 	- locked java.util.concurrent.locks.ReentrantLock$NonfairSync@1c4c77a
> {noformat}
> This happens mostly just after deployment of the jackrabbit repo. Once a single call
is successfully made the system keeps working.  



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message