Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 900698 (JBPAPP6-1025)

Summary: CLONE - Weld - Deadlock between SFSB Synchronization lock and Weld AbstractContext session context lock
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Marek Schmidt <maschmid>
Component: unspecifiedAssignee: Shelly McGowan <smcgowan>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: ales.justin, maschmid, rajesh.rajasekaran, sgilda, smcgowan
Target Milestone: ---   
Target Release: EAP 6.0.1   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBPAPP6-1025
Whiteboard: eap601candidate
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
JBoss AS 7.1.2.Final
Last Closed: 2012-10-29 05:52:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
helloworld.tar.gz
none
jboss-as-helloworld.war
none
jstack.txt none

Description Marek Schmidt 2012-07-10 14:07:36 UTC
Affects: Release Notes
Steps to Reproduce: 1. deploy the attached jboss-as-helloworld.war
2. go to http://127.0.0.1:8080/jboss-as-helloworld/Welcome
3. open the "Demand" link in the background
4. open the "Thing" link immediately after (<2000ms) 3.

5. Notice the "javax.ejb.ConcurrentAccessTimeoutException: JBAS014360: EJB 3.1 FR 4.3.14.1 concurrent access timeout on org.jboss.invocation.InterceptorContext@3fc7cf1 - could not obtain lock within 5000 MILLISECONDS" error page on the Thing page
project_key: JBPAPP6

There is a deadlock between SFSB Synchronization lock and the Weld AbstractContext session context lock, which causes the SFSB and the session context to be locked until the SFSB lock timeouts with javax.ejb.ConcurrentAccessTimeoutException.

The situation can be caused by a producer inside a SFSB, such as:

{code}
@Stateful
@SessionScoped
public class StatefulProducer
{
   @Inject
   private Instance<OnDemandBean> onDemandBean;
   
   @Produces
   @SessionScoped
   public Thing getThing() {
      return new Thing();
   }
   
   public void demand() {
      Thread.sleep(2000);      
      onDemandBean.get().foo();
   }
}
{code}

{code}
@SessionScoped
public class OnDemandBean implements Serializable {
   public void foo() {}
}
{code}

The problem occurs when there are two requests in the same session, with the first one calling StatefulProducer.demand and the other request injecting the Thing. The first request locks the SFSB synchronization lock first and then the Weld AbstractContext lock during the "onDemandBean.get()" call. The second request locks the Weld AbstractContext lock first and the SFSB synchronization lock next (during the producer getThing() call)

Comment 1 Marek Schmidt 2012-07-10 14:07:37 UTC
Link: Added: This issue Cloned from WELD-1158


Comment 2 Marek Schmidt 2012-07-10 14:08:36 UTC
Security: Added: Public
Docs QE Status: Added: NEW


Comment 3 Rajesh Rajasekaran 2012-07-11 20:21:31 UTC
Labels: Added: eap601candidate


Comment 4 Rajesh Rajasekaran 2012-09-07 22:45:19 UTC
The upstream issue seem to be fixed. Assigning to Shelly to accordingly set the fix version and make sure the upstream fixes are pulled in.

Comment 5 Shelly McGowan 2012-09-19 02:07:46 UTC
The upstream issue is Resolved with WELD 1.1.9.Final which is included in 6.0.1.  Pls verify against the latest 6.0.1 ER release available.

Comment 6 Marek Schmidt 2012-09-24 07:34:54 UTC
Verified on EAP 6.0.1 ER2

Comment 7 sgilda 2012-10-04 13:47:56 UTC
Does this need a release note for EAP 6.0.1? 
If so, the issue needs to be re-opened and the release notes flags set (Affects Release Notes, Not Yet Documented).
If not, the issue needs to be re-opened and the release notes flag set to "Release notes not required".


Comment 8 Marek Schmidt 2012-10-04 14:19:08 UTC
reopening for RN

Comment 9 Marek Schmidt 2012-10-04 14:19:33 UTC
Release Notes Docs Status: Added: Not Yet Documented
Affects: Added: Release Notes


Comment 10 Marek Schmidt 2012-10-04 14:27:16 UTC
Release Notes Text: Added: There was a potential deadlock between SFSB Synchronization lock and the Weld AbstractContext session context lock if a stateful session bean contains a producer method, which causes the SFSB and the session context to be locked until the SFSB lock timeouts with javax.ejb.ConcurrentAccessTimeoutException.


Comment 11 Dana Mison 2012-10-17 22:28:20 UTC
reopening to update release note info

Comment 12 Dana Mison 2012-10-17 22:30:08 UTC
Writer: Added: Darrin


Comment 13 Dana Mison 2012-10-22 04:39:58 UTC
Release Notes Text: Removed: There was a potential deadlock between SFSB Synchronization lock and the Weld AbstractContext session context lock if a stateful session bean contains a producer method, which causes the SFSB and the session context to be locked until the SFSB lock timeouts with javax.ejb.ConcurrentAccessTimeoutException. Added: If a stateful session bean contained a producer method there was the potential for a deadlock between the stateful session bean synchronization lock and the Weld AbstractContext session context lock.  Both locks would remain until the session bean lock timeout expired, throwing an timeout exception (javax.ejb.ConcurrentAccessTimeoutException).  The Weld component has been updated to deal with this scenario.  This potential dead lock state can no longer occur.


Comment 14 Dana Mison 2012-10-22 04:40:14 UTC
Release Notes Docs Status: Removed: Not Yet Documented Added: Documented as Resolved Issue


Comment 15 Dana Mison 2012-10-29 05:52:33 UTC
Release Notes Text: Removed: If a stateful session bean contained a producer method there was the potential for a deadlock between the stateful session bean synchronization lock and the Weld AbstractContext session context lock.  Both locks would remain until the session bean lock timeout expired, throwing an timeout exception (javax.ejb.ConcurrentAccessTimeoutException).  The Weld component has been updated to deal with this scenario.  This potential dead lock state can no longer occur. Added: If a stateful session bean contained a producer method there was the potential for a deadlock between the stateful session bean synchronization lock and the Weld AbstractContext session context lock.  Both locks would remain until the session bean lock timeout expired, throwing an timeout exception (`javax.ejb.ConcurrentAccessTimeoutException`).  The Weld component has been updated to deal with this scenario.  This potential dead lock state can no longer occur.


Comment 16 Anne-Louise Tangring 2012-11-13 20:12:03 UTC
Release Notes Docs Status: Removed: Documented as Resolved Issue 
Writer: Removed: Darrin 
Release Notes Text: Removed: If a stateful session bean contained a producer method there was the potential for a deadlock between the stateful session bean synchronization lock and the Weld AbstractContext session context lock.  Both locks would remain until the session bean lock timeout expired, throwing an timeout exception (`javax.ejb.ConcurrentAccessTimeoutException`).  The Weld component has been updated to deal with this scenario.  This potential dead lock state can no longer occur. 
Docs QE Status: Removed: NEW