directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn McKinney (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FC-38) Potential issues on synchronized protected elements
Date Tue, 04 Nov 2014 15:06:35 GMT

    [ https://issues.apache.org/jira/browse/FC-38?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14196190#comment-14196190
] 

Shawn McKinney commented on FC-38:
----------------------------------

Thread dump:
Full thread dump

""http-bio-8080"-exec-9@4941" daemon prio=5 tid=0x2c nid=NA waiting
  java.lang.Thread.State: WAITING
	  at sun.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:964)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1282)
	  at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:731)
	  at net.sf.ehcache.concurrent.ReadWriteLockSync.lock(ReadWriteLockSync.java:50)
	  at net.sf.ehcache.constructs.blocking.BlockingCache.acquiredLockForKey(BlockingCache.java:186)
	  at net.sf.ehcache.constructs.blocking.BlockingCache.get(BlockingCache.java:151)
	  at org.apache.directory.fortress.core.util.cache.EhCacheImpl.get(EhCacheImpl.java:77)
	  at org.apache.directory.fortress.core.rbac.RoleUtil.getGraph(RoleUtil.java:359)
	  at org.apache.directory.fortress.core.rbac.RoleUtil.getInheritedRoles(RoleUtil.java:183)
	  at org.apache.directory.fortress.core.rbac.AccessMgrImpl.authorizedRoles(AccessMgrImpl.java:267)
	  at org.apache.directory.fortress.realm.J2eePolicyMgrImpl.hasRole(J2eePolicyMgrImpl.java:407)
	  at org.apache.directory.fortress.realm.tomcat.TcAccessMgrImpl.hasRole(TcAccessMgrImpl.java:118)
	  at org.apache.directory.fortress.realm.tomcat.Tc7AccessMgrProxy.hasRole(Tc7AccessMgrProxy.java:178)
	  at org.apache.catalina.realm.RealmBase.hasResourcePermission(RealmBase.java:847)
	  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:557)
	  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
	  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
	  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
	  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
	  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
	  - locked <0x1358> (a org.apache.tomcat.util.net.SocketWrapper)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

"NioProcessor-2@4850" prio=5 tid=0x2b nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at sun.nio.ch.EPollArrayWrapper.epollWait(EPollArrayWrapper.java:-1)
	  at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:228)
	  at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:81)
	  at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87)
	  - locked <0x1359> (a sun.nio.ch.EPollSelectorImpl)
	  - locked <0x135a> (a java.util.Collections$UnmodifiableSet)
	  - locked <0x135b> (a sun.nio.ch.Util$2)
	  at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)
	  at org.apache.mina.transport.socket.nio.NioProcessor.select(NioProcessor.java:72)
	  at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1077)
	  at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

"NioProcessor-1@2464" prio=5 tid=0xf nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at sun.nio.ch.EPollArrayWrapper.epollWait(EPollArrayWrapper.java:-1)
	  at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:228)
	  at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:81)
	  at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87)
	  - locked <0x135d> (a sun.nio.ch.EPollSelectorImpl)
	  - locked <0x135e> (a java.util.Collections$UnmodifiableSet)
	  - locked <0x135f> (a sun.nio.ch.Util$2)
	  at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)
	  at org.apache.mina.transport.socket.nio.NioProcessor.select(NioProcessor.java:72)
	  at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1077)
	  at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8080"-exec-8@4750" daemon prio=5 tid=0x29 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at sun.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
	  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
	  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8080"-exec-7@4725" daemon prio=5 tid=0x28 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at sun.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
	  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
	  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8080"-exec-6@4657" daemon prio=5 tid=0x27 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at sun.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
	  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
	  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8080"-exec-5@4656" daemon prio=5 tid=0x26 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at sun.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
	  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
	  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8080"-exec-4@4658" daemon prio=5 tid=0x25 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at sun.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
	  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
	  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8080"-exec-3@4655" daemon prio=5 tid=0x24 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at sun.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
	  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
	  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8080"-exec-2@4654" daemon prio=5 tid=0x23 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at sun.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
	  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
	  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8080"-exec-1@4653" daemon prio=5 tid=0x22 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at sun.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
	  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
	  at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
	  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	  at java.lang.Thread.run(Thread.java:722)

"GC Daemon@1271" daemon prio=2 tid=0xd nid=NA waiting
  java.lang.Thread.State: WAITING
	  at java.lang.Object.wait(Object.java:-1)
	  at sun.misc.GC$Daemon.run(GC.java:117)

""ajp-bio-8009"-Acceptor-0@4647" daemon prio=5 tid=0x1f nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:-1)
	  at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
	  at java.net.ServerSocket.implAccept(ServerSocket.java:522)
	  at java.net.ServerSocket.accept(ServerSocket.java:490)
	  at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:59)
	  at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:211)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8443"-Acceptor-0@4645" daemon prio=5 tid=0x1d nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:-1)
	  at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
	  at java.net.ServerSocket.implAccept(ServerSocket.java:522)
	  at sun.security.ssl.SSLServerSocketImpl.accept(SSLServerSocketImpl.java:317)
	  at org.apache.tomcat.util.net.jsse.JSSESocketFactory.acceptSocket(JSSESocketFactory.java:182)
	  at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:211)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8080"-Acceptor-0@4639" daemon prio=5 tid=0x1b nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:-1)
	  at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
	  at java.net.ServerSocket.implAccept(ServerSocket.java:522)
	  at java.net.ServerSocket.accept(ServerSocket.java:490)
	  at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:59)
	  at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:211)
	  at java.lang.Thread.run(Thread.java:722)

"main@1" prio=5 tid=0x1 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:-1)
	  at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
	  at java.net.ServerSocket.implAccept(ServerSocket.java:522)
	  at java.net.ServerSocket.accept(ServerSocket.java:490)
	  at org.apache.catalina.core.StandardServer.await(StandardServer.java:447)
	  at org.apache.catalina.startup.Catalina.await(Catalina.java:707)
	  at org.apache.catalina.startup.Catalina.start(Catalina.java:653)
	  at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
	  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	  at java.lang.reflect.Method.invoke(Method.java:601)
	  at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
	  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)

""ajp-bio-8009"-AsyncTimeout@4648" daemon prio=5 tid=0x20 nid=NA sleeping
  java.lang.Thread.State: TIMED_WAITING
	  at java.lang.Thread.sleep(Thread.java:-1)
	  at org.apache.tomcat.util.net.JIoEndpoint$AsyncTimeout.run(JIoEndpoint.java:143)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8443"-AsyncTimeout@4646" daemon prio=5 tid=0x1e nid=NA sleeping
  java.lang.Thread.State: TIMED_WAITING
	  at java.lang.Thread.sleep(Thread.java:-1)
	  at org.apache.tomcat.util.net.JIoEndpoint$AsyncTimeout.run(JIoEndpoint.java:143)
	  at java.lang.Thread.run(Thread.java:722)

""http-bio-8080"-AsyncTimeout@4641" daemon prio=5 tid=0x1c nid=NA sleeping
  java.lang.Thread.State: TIMED_WAITING
	  at java.lang.Thread.sleep(Thread.java:-1)
	  at org.apache.tomcat.util.net.JIoEndpoint$AsyncTimeout.run(JIoEndpoint.java:143)
	  at java.lang.Thread.run(Thread.java:722)

"ContainerBackgroundProcessor[StandardEngine[Catalina]]@4631" daemon prio=5 tid=0x1a nid=NA
sleeping
  java.lang.Thread.State: TIMED_WAITING
	  at java.lang.Thread.sleep(Thread.java:-1)
	  at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1369)
	  at java.lang.Thread.run(Thread.java:722)

"fortress-demo@2795" daemon prio=5 tid=0x10 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at java.lang.Object.wait(Object.java:-1)
	  at java.util.TimerThread.mainLoop(Timer.java:552)
	  at java.util.TimerThread.run(Timer.java:505)

"Finalizer@3194" daemon prio=8 tid=0x3 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at java.lang.Object.wait(Object.java:-1)
	  at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
	  at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
	  at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:177)

"Reference Handler@4771" daemon prio=10 tid=0x2 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at java.lang.Object.wait(Object.java:-1)
	  at java.lang.Object.wait(Object.java:503)
	  at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)

"Signal Dispatcher@4770" daemon prio=9 tid=0x4 nid=NA runnable
  java.lang.Thread.State: RUNNABLE



> Potential issues on synchronized protected elements
> ---------------------------------------------------
>
>                 Key: FC-38
>                 URL: https://issues.apache.org/jira/browse/FC-38
>             Project: FORTRESS-CORE
>          Issue Type: Bug
>    Affects Versions: 1.0.0-RC39
>            Reporter: Emmanuel Lecharny
>            Priority: Critical
>             Fix For: 1.0.0-RC40
>
>
> There are some classes where we protect a field with a synchronized in order to avoid
concurrent modifications. That's ok, except that one should not access the field while it's
being updated. There are a few cases where it's done, and this should be fixed. 
> The way to do it is to use ReentrantReadWriteLock for that : it allows concurrent reads,
unless a write lock is taken. Writes will block other writes and all the reads until it's
done. 
> The OrgUnitP and PolicyP are protecting sets while updating it that aren't protected
when read (this is fixed for OrgUnitP)
> The AdminRoleUtil, HierUtil, PsoUtil, UsoUtil are all manipulating a graph object which
is synchronized on update, but not on read. This is probably more complex to fix than for
the OrgUnitP/PolicyP classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message