IBM Support

IZ86883: DEADLOCK IF MULTIPLE THREADS ACCESS WEBSPHERE MQ JAVA CLASS OBJECT

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When using a multi-threaded WebSphere MQ V6.0.2.6 classes for
    Java Message Service (JMS) application, the application
    experiences a deadlock if it is running when the queue manager
    it is connected to is shut down. A Javacore taken at the time
    of the deadlock shows the following stack traces for the
    threads that are involved:
    
    Deadlock detected !!!
    ---------------------
    Thread "Thread-1" (0x0000000081272300)
    is waiting for:
    sys_mon_t:0x0000000081635150 infl_mon_t: 0x00000000816351C0:
    com/ibm/mq/MQSPIQueue@0x000002000D023C48/0x000002000D023C60:
    which is owned by:
    Thread "Thread-2" (0x00000000806CA800)
    which is waiting for:
    sys_mon_t:0x00000000816350B0 infl_mon_t: 0x0000000081635120:
    com/ibm/mq/MQSPIQueueManager@0x000002000CEAE760/
    0x000002000CEAE778:
    which is owned by:
    Thread "Thread-1" (0x0000000081272300)
    
    
    Thread Details
    ------------------
    "Thread-2" J9VMThread:0x00000000806CA800,
    j9thread_t:0x0000000080AA7820,
    java/lang/Thread:0x000002000CDFDBD0, state:B, prio=5
    (native thread ID:0x5675, native priority:0x5,
    native policy:UNKNOWN)
    (native stack address range from:0x0000020020800000,
    to:0x0000020020840000, size:0x40000)
    Java callstack:
    at com/ibm/mq/MQQueueManager.disconnect
    (MQQueueManager.java:2176)
    at com/ibm/mq/MQQueueManager.errorOccurred
    (MQQueueManager.java:3211(Compiled Code))
    :    :     :    :    :    :     :    :    :    :    :
    
    "Thread-1" J9VMThread:0x0000000081272300,
    j9thread_t:0x0000000080EF6360,
    java/lang/Thread:0x000002000ADA8D98, state:B, prio=5
    (native thread ID:0x3B94, native priority:0x5,
    native policy:UNKNOWN)
    (native stack address range from:0x0000020017CF7000,
    to:0x0000020017D37000, size:0x40000)
    Java callstack:
    at com/ibm/mq/MQQueueManager.cleanup
    (MQQueueManager.java:3066(Compiled Code))
    at com/ibm/mq/MQQueueManager.cleanup
    (MQQueueManager.java:3048(Compiled Code))
    at com/ibm/mq/MQQueueManager.disconnect
    (MQQueueManager.java:2184)
    at com/ibm/mq/MQSESSIONClient.errorCloseComms
    (MQSESSIONClient.java:2962)
    :    :     :    :    :    :     :    :    :    :    :
    
    
    
    where Thread-1 and Thread-2 are the names of the threads in the
    system that are involved.
    

Local fix

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    This issue affects users of:
    
    - The WebSphere MQ V6 classes for Java.
    - The WebSphere MQ V6 classes for Java Message Service (JMS).
    - The WebSphere MQ V6 Resource Adapter.
    - The WebSphere MQ V7 classes for Java.
    - The WebSphere MQ V7 classes for Java Message Service (JMS).
    - The WebSphere MQ V7 Resource Adapter.
    - The WebSphere Application Server V6.1 WebSphere MQ messaging
    provider.
    - The WebSphere Application Server V7 WebSphere MQ messaging
    provider.
    - The WebSphere Application Server V6.x WebSphere MQ messaging
    provider who have reconfigured the application server to use
    the WebSphere MQ V6.0.2.x classes for JMS.
    - - The WebSphere Application Server V6.x WebSphere MQ
    messaging provider who have reconfigured the application server
    to use the WebSphere MQ V7 classes for JMS.
    
    that have applications where two threads or more threads are
    accessing the same WebSphere MQ queue manager concurrently when
    the queue manager is shut down.
    
    Platforms affected:
    All Distributed (iSeries, all Unix and Windows) +Java
    ****************************************************************
    PROBLEM SUMMARY:
    When a WebSphere MQ queue manager is shut down, any threads
    that are making WebSphere MQ API calls are notified, and start
    to perform error handling. Part of the error handling involves:
    
    - locking the internal object that represents the physical
    connection to the queue manager.
    - cleaning up the physical connection.
    - locking the internal objects that represent the queues on
    the queue manager that have been used by the application.
    - closing all of the open queue handles.
    
    The issue reported in this APAR occurred if one or more threads
    in the system were if either getting a message or putting a
    message to a WebSphere MQ queue when the queue manager was shut
    down.
    
    When putting a message to a queue, or getting a message from a
    queue, an internal lock was taken on the object representing
    the queue. If the queue manager was shut down during this
    operation, the internal lock was only released once the error
    handling had completed.
    
    The issue reported in this APAR arose if another thread
    detected the fact that the queue manager was shutting down at
    the same time as the threads doing the put or get operations.
    
    The first thread locked the internal object representing the
    connection to the queue manager, and then tried to lock the
    internal object representing the queue.
    
    However, the internal object representing the queue was locked
    by the thread doing the put or get operation. The put or get
    operation failed, because the queue manager was shutting down,
    which meant that the thread doing the put or get then tried to
    lock the object representing the connection to the queue
    manager so that it could perform the necessary error handling.
    
    This resulted in a deadlock.
    
    Thread 1                   Thread 2
    ----------                 ----------
    Lock queue object
    Starts put or get
    operation
    Detects queue manager     Detects queue manager
    is stopping                is stopping
    Locks queue manager
    object
    Tries to lock queue       Tries to lock queue
    manager object                object
    

Problem conclusion

  • The WebSphere MQ classes for Java (used by the WebSphere MQ
    classes for JMS, the WebSphere MQ Resource Adapter and the
    WebSphere Application Server WebSphere MQ messaging
    provider) have been changed so that the lock on the internal
    queue object is released before any error handling takes place.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
                       v6.0
    Platform           Fix Pack 6.0.2.11
    --------           --------------------
    Windows            U200326
    AIX                U839822
    HP-UX (PA-RISC)    U840685
    HP-UX (Itanium)    U840690
    Solaris (SPARC)    U840686
    Solaris (x86-64)   U840693
    iSeries            tbc_p600_0_2_11
    Linux (x86)        U840687
    Linux (x86-64)     U840692
    Linux (zSeries)    U840688
    Linux (Power)      U840689
    Linux (s390x)      U840691
    
                       v7.0
    Platform           Fix Pack 7.0.1.7
    --------           --------------------
    Windows            U200333
    AIX                U843721
    HP-UX (PA-RISC)    U844089
    HP-UX (Itanium)    U844094
    Solaris (SPARC)    U844090
    Solaris (x86-64)   U844096
    iSeries            tbc_p700_0_1_7
    Linux (x86)        U844091
    Linux (x86-64)     U844095
    Linux (zSeries)    U844092
    Linux (Power)      U844093
    
    The latest available maintenance can be obtained from
    'WebSphere MQ Recommended Fixes'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006037
    
    If the maintenance level is not yet available, information on
    its planned availability can be found in 'WebSphere MQ
    Planned Maintenance Release Dates'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006309
    ---------------------------------------------------------------
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ86883

  • Reported component name

    WMQ LIN X86 V6

  • Reported component ID

    5724H7204

  • Reported release

    600

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-10-19

  • Closed date

    2010-12-24

  • Last modified date

    2011-07-22

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WMQ LIN X86 V6

  • Fixed component ID

    5724H7204

Applicable component levels

  • R600 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
31 March 2023