IBM Support

PH40768: MQ Z/OS: MQGET WITH MQMO_MATCH_MSG_TOKEN SOMETIMES RETURNS A DUPLICATE MESSAGE TOKEN

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The circumstances for the problem as initially reported:
    We are receiving duplicate message tokens when browsing a queue
    on an MQ for z/OS queue manager with the MQ for Java API with
    read ahead turned on. The message payload is around 100,000
    bytes of size.  There is only one message on the queue, but the
    message is received twice when the application does a repeated
    GET with MQOO_BROWSE. The expected behavior would be the first
    GET to succeed and the second to fail with
    MQRC_NO_MSG_AVAILABLE.
    
    The issue occurs for messages of a size of around 100000 bytes
    and browsing with read ahead turned on browsing z/OS. It was
    not noticed for messages significantly smaller (e.g. 50000
    bytes) or bigger (e.g. 150000 bytes) on that platform. It also
    was not noticed on distributed platforms.
    
    
    As initially reported, the problem did not occur with read
    ahead turned off (MQOO_NO_READ_AHEAD), but subsequent testing
    found that the problem does not depend on whether read-ahead is
    used.
    
    The Java application issues MQDestination gets against the
    target queue. These calls resolve to multiple MQGET calls to
    the queue manager. The first call is made with
    MQGMO_BROWSE_NEXT and a small buffer length which fails with
    MQRC_TRUNCATED_MSG_FAILED. A subsequent MQGET with
    MQGMO_BROWSE_NEXT and match option MQMO_MATCH_MSG_TOKEN is then
    made with the correct buffer length to again browse the
    previously truncated message.
    
    CSECT CSQIMGEK is called to get the message with the specified
    MsgToken, and it is here where the problem lies. As part of
    validating the supplied MsgToken, the routine does a check
    against the browse cursor priority, but unfortunately the check
    is done against an uninitialized stack variable. The result of
    the check is used to decide whether the message matches the
    user-supplied MsgToken.
    
    It follows that many subtle differences which change the call
    stack leading up to the CSQIMGEK call are susceptible to this
    problem. The problem here is not related to read ahead
    processing.  The problem could also affect MQGETs using
    selectors.
    
    The problem was also reliably recreated with a C bindings
    connection without the use of read ahead.
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: All users of IBM MQ for z/OS Version 9       *
    *                 Release 1 Modification 0, Release 2          *
    *                 Modification 0 and Release 3 Modification 0. *
    ****************************************************************
    * PROBLEM DESCRIPTION: When browsing a large message with      *
    *                      the MQMO_MATCH_MSG_TOKEN and            *
    *                      MQGMO_BROWSE_NEXT options set,          *
    *                      the same message can be retrieved       *
    *                      twice.                                  *
    ****************************************************************
    The code that checks whether a message token has already been
    matched with a message was not checking the put time
    sufficiently which allowed for the same message to be retrieved
    twice in this scenario.
    

Problem conclusion

  • The code has been updated with improved checks to ensure we
    don't get the same message twice. As a result of this,
    duplicate messages are no longer returned when getting a large
    message with the MQMO_MATCH_MSG_TOKEN and
    MQGMO_BROWSE_NEXT options set.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PH40768

  • Reported component name

    IBM MQ Z/OS V9

  • Reported component ID

    5655MQ900

  • Reported release

    100

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2021-09-21

  • Closed date

    2022-12-20

  • Last modified date

    2022-12-20

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

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

    UI83189 UI83190 UI83191

Modules/Macros

  • CSQIMGEK
    

Fix information

  • Fixed component name

    IBM MQ Z/OS V9

  • Fixed component ID

    5655MQ900

Applicable component levels

  • R100 PSY UI83191

       UP22/11/29 P F211

  • R200 PSY UI83190

       UP22/11/29 P F211

  • R300 PSY UI83189

       UP22/11/29 P F211

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"100","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
20 December 2022