PQ94554: STARTING A ASYNCHBEAN WORKMANAGER APP FROM A SERVLET INIT() METHOD HANGS DUE TO A DEADLOCK

 A fix is available

Required WebSphere interim fixes for WebSphere Portal version 5.1.0.3



APAR status
Closed as program error.

Error description
When attempting to start a Work object using the
init() method of a servlet, a deadlock can occur if an
WorkManager Alarm thread is procesing an alarm event -- the
alarm event occurs when a timer pops which causes the Alarm
thread to check to see if an AsynchBean event has timed out.
   The following message may be logged in SystemOut.
3cdaf2b5 ThreadMonitor W WSVR0605W: Thread "
wpsDefaultWorkManager.Alarm
Pool : 0" (661ff2a0) has been active for 630,287 milliseconds
and may be hung.
.
A javacore taken at the time would show this
1LKDEADLOCK    Deadlock detected !!!
NULL           ---------------------
NULL
2LKDEADLOCKTHR  Thread "wpsDefaultWorkManager.Alarm Pool : 0"
(0x57C8A7A0)
3LKDEADLOCKWTR    is waiting for:
4LKDEADLOCKMON      sys_mon_t:0x3003F698 infl_mon_t: 0x00000000:
4LKDEADLOCKOBJ
com.ibm.ws.webcontainer.WebContainer@32D781A0/32D781A8:
3LKDEADLOCKOWN    which is owned by:
2LKDEADLOCKTHR  Thread "Thread-1" (0x535938A0)
3LKDEADLOCKWTR    which is waiting for:
4LKDEADLOCKMON      sys_mon_t:0x56CA4D28 infl_mon_t: 0x00000000:
4LKDEADLOCKOBJ
com.ibm.ws.runtime.component.JavaCompContextMgrImpl@310CB840/310
CB848:
3LKDEADLOCKOWN    which is owned by:
2LKDEADLOCKTHR  Thread "wpsDefaultWorkManager.Alarm Pool : 0"
(0x57C8A7A0)
.
3XMTHREADINFO "Thread-1"
(TID:0x300CB5F8,sys_thread_t:0x535938A0,
    state:CW, native ID:0x809) prio=5
4XESTACKTRACE    at com.ibm.ws.asynchbeans.J2EEServiceManager.
peek(J2EEServiceManager.java:157)
4XESTACKTRACE          at
com.ibm.ws.asynchbeans.AlarmImpl.init(AlarmImpl.java:84)
4XESTACKTRACE          at
com.ibm.ws.asynchbeans.AlarmImpl.<init>(AlarmImpl.java:63)
4XESTACKTRACE          at
com.ibm.ws.asynchbeans.AlarmManagerImpl.
create(AlarmManagerImpl.java:97)
4XESTACKTRACE          at com.ibm.wps.services.workmanager.impl
WorkDispatcherAsynchBeanImpl.create(WorkDispatcherAsynchBeanImp
l.java:103)
4XESTACKTRACE          at
com.ibm.wps.services.workmanager.impl.WorkManagerServiceImpl.
create(WorkManagerServiceImpl.java:172)
4XESTACKTRACE          at
com.ibm.wps.services.workmanager.impl.WorkManagerServiceImpl.
create(WorkManagerServiceImpl.java:162)
4XESTACKTRACE          at com.presence.connect.dispatcher.
EventDispatcher.start(Unknown Source)
4XESTACKTRACE          at
com.presence.connect.Connect.startDispatcher(Unknown Source)
4XESTACKTRACE          at com.presence.connect.Connect.
init(UnknownSource)
4XESTACKTRACE          at com.presence.connect.Connect.
safeInit(Unknown Source)
4XESTACKTRACE          at
com.presence.connect.Connect.getInstance(Unknown Source)
4XESTACKTRACE          at
com.presence.connect.ConnectServlet.init(Unknown Source)
.
"wpsDefaultWorkManager.Alarm Pool : 0" (TID:0x30518028,
thread_t:0x57C8A7A0, state:CW, native ID:0x191F) prio=5
    at com.ibm.ws.runtime.component.WebContainerImpl.
getClassLoader(WebContainerImpl.java:440)
    at com.ibm.ws.asynchbeans.J2EEServiceManager.
getClassLoader(J2EEServiceManager.java:707)
    at com.ibm.ws.runtime.component.JavaCompContextMgrImpl.
setCL(JavaCompContextMgrImpl.java:227)
    at com.ibm.ws.runtime.component.JavaCompContextMgrImpl.
push(JavaCompContextMgrImpl.java:111)
    at com.ibm.ws.asynchbeans.J2EEServiceManager.pushContext
(J2EEServiceManager.java:248)
    at com.ibm.ws.asynchbeans.J2EEContext.push(J2EEContext.java
    at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java
    at com.ibm.ws.asynchbeans.AlarmImpl.alarm(AlarmImpl.java:16
Local fix Problem summary
****************************************************************
* USERS AFFECTED: All WebSphere Application Server Enterprise  *
*                 Edition Asynchronous Beans users who use     *
*                 Asynchronous Beans from Servlets during      *
*                 servlet initialization.  This affects        *
*                 version 5.0.2, 5.1 and 5.1.1 users.          *
****************************************************************
* PROBLEM DESCRIPTION: Submitting a Work to a WorkManager      *
*                      from within a servlet's init() method   *
*                      may hang.  In addition, workStarted()   *
*                      event notifications may not occur       *
*                      until after the init() method           *
*                      completes.                              *
****************************************************************
* RECOMMENDATION: Apply intermediate fix PQ94554 or a service  *
*                 pack with this fix.                          *
****************************************************************
The WorkManager context propagation code is synchronizing while
propagating the servlet context.  If another thread was running
using that same servlet's context (such as an Alarm or another
WorkManager), then the method submitting the work to the
WorkManager would deadlock.
Problem conclusion
The synchronization code in the context propagation code
is not necessary and was removed.  This eliminated the
deadlock scenario.
Temporary fix Comments
APAR information
APAR number PQ94554
Reported component name WAS ENTERPRISE
Reported component ID 5630A3700
Reported release 00W
Status CLOSED PER
PE NoPE
HIPER NoHIPER
Special Attention NoSpecatt
Submitted date 2004-09-21
Closed date 2004-10-11
Last modified date 2005-10-20

APAR is sysrouted FROM one or more of the following:

APAR is sysrouted TO one or more of the following:

Modules/Macros

Publications Referenced

Fix information

Applicable component levels
R003 PSY    UP
R00A PSY    UP
R00H PSY    UP
R00I PSY    UP
R00S PSY    UP
R00W PSY    UP


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Enterprise Edition (EE)
Operating system(s):
Software version: 00W
Software edition:
Reference #: PQ94554
IBM Group: Software Group
Modified date: Oct 20, 2005