javax.slee.SLEEException: timeout while acquiring lock

45 views
Skip to first unread message

Stephen Kouretas

unread,
Mar 25, 2014, 10:36:22 AM3/25/14
to mobicent...@googlegroups.com

If anyone could help, I would greatly appreciate it.

I'm using Mobicents JAIN SLEE-2.7.0.FINAL JBOSS-5.1.0.GA.

I'm receiving a javax.slee.SLEEException: timeout while acquiring lock.

I have an SBB that is using an initial-event-selector-method.

What I am trying to do is have an SBB that will receive events from different Resource Adaptors and activities. The Initial Event Selector method is used to return a user id as the convergence name for the events so that events for the same user from the different sources can be routed to the same SBB.

I believe the following situation is what causes the timeout:

1.) An event related to an activity calls the initial-event-selector-method and creates a new Root SBB.
2.) Some time later another event occurs and the activity to which the SBB is attached ends.
3.) At the same time that the 1st activity is ending, another initial event is received which computes to the same convergence name. At this point a timeout exception occurs trying to aquire the lock for the SBB. 

I believe what is happening is that the 1st activity is ending, and the SBB is being reclaimed, however at the same time a new initial event comes in before the handling of the ending of the activity has been commited.  The SbbEntityFactory retrieves the lock from the lock facility and attempts to aquire the lock, however, I believe the lock that is actually retrieved is the lock for the SBB which is in the process of being reclaimed.  Hence the attempt to aquire the lock times out after 10s and the exception is thrown.  This also causes all events that are added to this EventRouterExecutor to also be delayed by 10 seconds.

This appears to be a race condition in the way in which the locks for SBBs are being managed.


Below is the exception and stack trace:

javax.slee.SLEEException: timeout while acquiring lock java.util.concurrent.locks.ReentrantLock@4a0a2e[Locked by thread pool-22-thread-1] for sbb entity with id /ServiceID[name=LiveMonitorService,vendor=AudioCodes,version=1.0]/_____169
 at org.mobicents.slee.runtime.sbbentity.SbbEntityFactoryImpl.lockOrFail(SbbEntityFactoryImpl.java:330)
 at org.mobicents.slee.runtime.sbbentity.SbbEntityFactoryImpl.createRootSbbEntity(SbbEntityFactoryImpl.java:110)
 at org.mobicents.slee.runtime.eventrouter.routingtask.InitialEventProcessor.processInitialEvent(InitialEventProcessor.java:258)
 at org.mobicents.slee.runtime.eventrouter.routingtask.EventRoutingTaskImpl.routeQueuedEvent(EventRoutingTaskImpl.java:318)
 at org.mobicents.slee.runtime.eventrouter.routingtask.EventRoutingTaskImpl.run(EventRoutingTaskImpl.java:126)
 at org.mobicents.slee.runtime.eventrouter.EventRouterExecutorImpl$EventRoutingTaskStatsCollector.run(EventRouterExecutorImpl.java:73)
 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)


Any help would be greatly appreciated.
Regards,
Stephen Kouretas

Sachin Parnami

unread,
Mar 25, 2014, 11:03:31 PM3/25/14
to mobicent...@googlegroups.com
Hi,

AFAIK it is happening when you receive a event and your InitialEventSelector method is not able to acquire lock on SBB Entity as per the convergence name which already exist, reason could be SBB entity is busy in doing other stuff and queue to acquire lock keeps on growing and timeout happens after 10 Seconds.

There could be multiple reason SBB entity taking more time
1) creating ChildSbb and business logic execution from them and root waits till then.
2) multiple DB calls.
etc..

HIH

Regards,
Sachin Parnami



--
You received this message because you are subscribed to the Google Groups "mobicents-public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobicents-publ...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages