MQRC 2161: Queue manager quiescing
MQRC 2161 (MQRC_
Other names for this code
Also written as RC2161, reason code 2161, MQ 2161, MQ error 2161, MQRC_Q_MGR_QUIESCING, 0871, 0x0871, queue manager quiescing, FAIL_IF_QUIESCING, MQJE001 Reason 2161.
What it means
When an administrator stops a queue manager in a controlled way, it quiesces. It lets connected applications keep working and waits for them to disconnect before it ends. During that time, MQOPEN, MQPUT, MQPUT1 and MQGET can still succeed. An application can ask to be told about the shutdown instead, with MQOO_
That option matters for the operator. A controlled shutdown (endmqm with the default -c option on distributed MQ, or STOP QMGR with the default MODE(QUIESCE) on z/OS) waits for applications. A program that never uses the fail-if-quiescing options and sits in a long MQGET wait can keep the queue manager from stopping. Programs that handle 2161 let it stop on time.
IBM lists two other cases. On z/OS, a batch application on an LPAR with no queue manager installed, or a CICS application with no connection established, can receive 2161. On IBM i, an application in compatibility mode with no connection can receive it.
Common causes
- An administrator started a controlled shutdown with
endmqm QM1orendmqm -c QM1on distributed MQ. - On z/OS, an operator issued
STOP QMGRorSTOP QMGR MODE(QUIESCE). - A planned failover or maintenance window that stops the queue manager in a controlled way.
- On z/OS, a batch job runs on an LPAR without a queue manager, or a CICS program runs when CICS has no MQ connection.
How to find the problem
- Check the queue manager error log or z/OS SYSLOG for the shutdown messages and the time they started.
- Run
dspmqon distributed MQ. It shows the status as Quiescing while a controlled shutdown is in progress. - If the shutdown seems stuck, list the remaining connections with
DISPLAY CONN(*) APPLTAGto see which applications haven't disconnected. - On z/OS CICS, check the adapter connection with
CKQCorCEMT INQUIRE MQCONN.
How to fix it
- Make the application end tidily on 2161. Commit or back out its unit of work, close its queues and disconnect.
- If the program needs to finish a unit of work, it can repeat the call without the fail-if-quiescing option, but it shouldn't start new work.
- Use the fail-if-quiescing options on every MQOPEN, MQPUT and MQGET in long-running programs, so they never hold up a shutdown.
- Restart or reconnect the application after the queue manager is back, either by hand or with retry logic.
IBM documentation
IBM documentation: MQRC 2161. Use the documentation for your installed release.
Related codes
Questions
Is MQRC 2161 an error?
Not really. It is the queue manager telling the application to finish up because a controlled shutdown is under way.
What is the difference between 2161 and 2162?
2161 comes during a controlled shutdown and the application can still finish its current work. 2162 means the queue manager is stopping and no more MQI calls will work.
Why does endmqm take so long to finish?
A controlled shutdown waits for applications to disconnect. Programs that don't use the fail-if-quiescing options, especially ones in long MQGET waits, keep it waiting.