{"id":6488,"date":"2017-02-11T18:35:36","date_gmt":"2017-02-11T10:35:36","guid":{"rendered":"http:\/\/rmohan.com\/?p=6488"},"modified":"2017-02-11T18:35:36","modified_gmt":"2017-02-11T10:35:36","slug":"ipprocs-or-opprocs-greater-than-0-in-a-queue-prevents-normal-termination-of-queue-manager-by-endmqm-qmgrname-need-to-use-endmqm-i-qmgrname","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6488","title":{"rendered":"IPPROCS or OPPROCS greater than 0 in a queue prevents normal termination of queue manager by &#8220;endmqm QmgrName&#8221; (Need to use: endmqm -i QmgrName)"},"content":{"rendered":"<div class=\"ibm-container-body\">\n<h2 class=\" ibm-h4 ibm-bold\">Problem(Abstract)<\/h2>\n<p>You notice that when the WebSphere MQ (WMQ) queue attributes of IPPROCS or OPPROCS are greater than 0, and try to end the queue manager by issuing &#8220;endmqm QmgrName&#8221;, then the queue manager goes into &#8220;quiescing&#8221; but it does not fully terminate.<\/p>\n<p>Is there a way to speed up the shutdown of the queue manager?<\/p>\n<h2 class=\" ibm-h4 ibm-bold\">Resolving the problem<\/h2>\n<div class=\"ibm-domino-rtf\">\n<p>If &#8220;endmqm QMgrName&#8221; does not effectively end the queue manager, you can try to speed up the shutdown process by adding the flag -i such as:<br \/>\n<b><i>endmqm -i QMgrName<\/i><\/b><b> <\/b><\/p>\n<p><b><u>Background:<\/u><\/b><\/p>\n<p>The following page has more information about the <a href=\"http:\/\/www.ibm.com\/support\/knowledgecenter\/SSFKSJ_7.0.1\/com.ibm.mq.explorer.doc\/e_status_queue.htm\" target=\" \">IPPROCS and OPPROCS attributes for a queue<\/a>.<\/p>\n<p><b>Queue status attributes:<\/b><\/p>\n<p><b>Attribute: Open input count<\/b><br \/>\nMeaning: This is the number of applications that are currently connected to the queue to get messages from the queue.<br \/>\nMQSC parameter: IPPROCS<\/p>\n<p><b>Attribute: Open output count <\/b><br \/>\nMeaning: This is the number of applications that are currently connected to the queue to put messages on the queue.<br \/>\nMQSC parameter: OPPROCS<\/p>\n<p>If &#8220;endmqm QMgrName&#8221; does not effectively end the queue manager, you can try to speed up the shutdown process by adding the flag -i such as:<br \/>\n<i>endmqm -i QMgrName<\/i><\/p>\n<p>For more details, see the product documentation:<br \/>\n<a href=\"http:\/\/www.ibm.com\/support\/knowledgecenter\/SSFKSJ_7.0.1\/com.ibm.mq.amqzag.doc\/fa15800_.htm\" target=\" \">endmqm<\/a><\/p>\n<p>The default (endmqm QMgrName) is to use &#8220;-c&#8221; as in: endmqm -c QMgrName<\/p>\n<p><b>-c Controlled (or quiesced) shutdown : <\/b><br \/>\nThis is the default. The queue manager stops, but only after all applications have disconnected. Any MQI calls currently being processed are completed. Control is returned to you immediately and you are not notified of when the queue manager has stopped. The effect on any client applications connected through a server-connection channel is equivalent to a STOP CHANNEL command issued in QUIESCE mode.<br \/>\n&gt;&gt; Note: If an application has opened a queue for put or for get, but still is connected, then this will prevent the queue manager from ending. It will remain in &#8220;quiescing&#8221;.<\/p>\n<p><b>-i Immediate shutdown:<\/b><br \/>\nThe queue manager stops after it has completed all the MQI calls currently being processed. Any MQI requests issued after the command has been issued fail. Any incomplete units of work are rolled back when the queue manager is next started.<br \/>\nControl is returned after the queue manager has ended.<br \/>\nThe effect on any client applications connected through a server-connection channel is equivalent to a STOP CHANNEL command issued in FORCE mode.<br \/>\n&gt;&gt; Note: If a client application has opened a queue and still is connected, such as the MQ Explorer, then this option will terminate the server-client connection, allowing the queue manager to terminate.<\/p>\n<p><b>-p Preemptive shutdown: <\/b><br \/>\nWARNING: !!!! Use this type of shutdown only in exceptional circumstances. For example, when a queue manager does not stop as a result of a normal endmqm command. !!!<\/p>\n<p>The queue manager might stop without waiting for applications to disconnect or for MQI calls to complete. This can give unpredictable results for WebSphere MQ applications.<br \/>\nThe shutdown mode is set to immediate shutdown. If the queue manager has not stopped after a few seconds, the shutdown mode is escalated, and all remaining queue manager processes are stopped.<br \/>\nThe effect on any client applications connected through a server-connection channel is equivalent to a STOP CHANNEL command issued in TERMINATE mode.<\/p>\n<p><b><u>+++ Scenario<\/u><\/b><\/p>\n<p>The impact that these attributes have whenever they have a value greater than Zero, when trying to terminate the queue manager is best described by a simple scenario, which is described in the rest of this technote.<\/p>\n<p>A queue Q1 in the queue manager QM_VER has not been opened by any application. Thus, IPPROCS and OPPROCS are 0:<br \/>\nIn one window enter:<\/p>\n<p><tt>$ runmqsc QM_VER<\/tt><br \/>\n<tt>display qstatus(Q1)<\/tt><br \/>\n<tt>\u00a0 \u00a0 \u00a02 : display qstatus(Q1)<\/tt><br \/>\n<tt>AMQ8450: Display queue status details.<\/tt><br \/>\n<tt>\u00a0 \u00a0QUEUE(Q1) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 TYPE(QUEUE)<\/tt><br \/>\n<tt>\u00a0 \u00a0CURDEPTH(0) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/tt><tt><b>IPPROCS(0)<\/b><\/tt><br \/>\n<tt>\u00a0 \u00a0MSGAGE( ) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/tt><tt><b>OPPROCS(0)<\/b><\/tt><\/p>\n<p>In another window, the MQ sample command &#8220;amqsput&#8221; is issued to put a message:<\/p>\n<p><tt>$ amqsput Q1 QM_VER<\/tt><br \/>\n<tt>Sample AMQSPUT0 start<\/tt><br \/>\n<tt>target queue is Q1<\/tt><\/p>\n<p>Notice that the text of the message has not being entered yet. The application is just waiting for the user to enter the text. The application has already opened the queue and thus, the counter for OPPROCS has been incremented from 0 to 1:<\/p>\n<p><tt>$ runmqsc QM_VER<\/tt><br \/>\n<tt>display qstatus(Q1)<\/tt><br \/>\n<tt>\u00a0 \u00a0 \u00a03 : display qstatus(Q1)<\/tt><br \/>\n<tt>AMQ8450: Display queue status details.<\/tt><br \/>\n<tt>\u00a0 \u00a0QUEUE(Q1) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 TYPE(QUEUE)<\/tt><br \/>\n<tt>\u00a0 \u00a0CURDEPTH(0) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/tt><tt><b>IPPROCS(0)<\/b><\/tt><br \/>\n<tt>\u00a0 \u00a0MSGAGE( ) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/tt><tt><b>OPPROCS(1)<\/b><\/tt><\/p>\n<p>In yet another window, the MQ sample command &#8220;amqsget&#8221; is issued to get a message:<\/p>\n<p><tt>$ amqsget Q1 QM_VER<\/tt><br \/>\n<tt>Sample AMQSGET0 start<\/tt><\/p>\n<p>Notice that now the counter for IPPROCS has been incremented from 0 to 1, and that OPPROCS is still at 1 because amqsput is still connected:<\/p>\n<p><tt>$ runmqsc QM_VER<\/tt><br \/>\n<tt>display qstatus(Q1)<\/tt><br \/>\n<tt>\u00a0 \u00a0 \u00a04 : display qstatus(Q1)<\/tt><br \/>\n<tt>AMQ8450: Display queue status details.<\/tt><br \/>\n<tt>\u00a0 \u00a0QUEUE(Q1) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 TYPE(QUEUE)<\/tt><br \/>\n<tt>\u00a0 \u00a0CURDEPTH(0) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<\/tt><tt><b>\u00a0IPPROCS(1)<\/b><\/tt><br \/>\n<tt>\u00a0 \u00a0MSGAGE( ) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/tt><tt><b>OPPROCS(1)<\/b><\/tt><\/p>\n<p>But 30 seconds later, amqsget terminates because no messages arrived within 30 seconds, and now the IPPROCS counter decreased from 1 to 0. But amqsput is still connected, waiting for the user to enter a message and thus OPPROCS is still 1.<\/p>\n<p><tt>$ runmqsc QM_VER<\/tt><br \/>\n<tt>display qstatus(Q1)<\/tt><br \/>\n<tt>\u00a0 \u00a0 \u00a03 : display qstatus(Q1)<\/tt><br \/>\n<tt>AMQ8450: Display queue status details.<\/tt><br \/>\n<tt>\u00a0 \u00a0QUEUE(Q1) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 TYPE(QUEUE)<\/tt><br \/>\n<tt>\u00a0 \u00a0CURDEPTH(0) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/tt><tt><b>IPPROCS(0)<\/b><\/tt><br \/>\n<tt>\u00a0 \u00a0MSGAGE( ) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/tt><tt><b>OPPROCS(1)<\/b><\/tt><\/p>\n<p>Let&#8217;s assume that we wanted to terminate the queue manager, keeping in mind that amqsput is still running and connected to the queue (OPPROCS is still 1):<\/p>\n<p><tt>$ endmqm QM_VER<\/tt><br \/>\nQuiesce request accepted. The queue manager will stop when all outstanding work<br \/>\nis complete.<\/p>\n<p>Notice that we cannot make new connections, not even running runmqsc:<\/p>\n<p><tt>$ runmqsc QM_VER<\/tt><br \/>\n<tt>AMQ8156: WebSphere MQ queue manager quiescing.<\/tt><\/p>\n<p><tt>$ amqsget Q1 QM_VER<\/tt><br \/>\n<tt>Sample AMQSGET0 start<\/tt><br \/>\n<tt>MQCONN ended with reason code 2161<\/tt><\/p>\n<p><tt>$ mqrc 2161<\/tt><br \/>\n<tt>\u00a0 \u00a0 \u00a0 2161 \u00a00x00000871 \u00a0MQRC_Q_MGR_QUIESCING<\/tt><\/p>\n<p>The monitoring of the MQ processes for this queue manager do not show any changes and the processes are still running.<\/p>\n<p><tt>$ ps -ef | grep -i QM_VER<\/tt><br \/>\n<tt>mqm \u00a0 \u00a0 \u00a0 1869 \u00a0 \u00a0 1 \u00a00 13:28 ? \u00a0 \u00a0 \u00a0 \u00a000:00:00 amqzxma0 -m QM_VER<\/tt><br \/>\n<tt>mqm \u00a0 \u00a0 \u00a0 1874 \u00a01869 \u00a00 13:28 ? \u00a0 \u00a0 \u00a0 \u00a000:00:00 \/opt\/mqm\/bin\/amqzfuma -m QM_VER<\/tt><br \/>\n<tt>mqm \u00a0 \u00a0 \u00a0 1878 \u00a01869 \u00a00 13:28 ? \u00a0 \u00a0 \u00a0 \u00a000:00:00 amqzmuc0 -m QM_VER<\/tt><br \/>\n<tt>mqm \u00a0 \u00a0 \u00a0 1884 \u00a01869 \u00a00 13:28 ? \u00a0 \u00a0 \u00a0 \u00a000:00:00 amqzmur0 -m QM_VER<\/tt><br \/>\n<tt>mqm \u00a0 \u00a0 \u00a0 1885 \u00a01869 \u00a00 13:28 ? \u00a0 \u00a0 \u00a0 \u00a000:00:00 amqzmuf0 -m QM_VER<\/tt><br \/>\n<tt>mqm \u00a0 \u00a0 \u00a0 1888 \u00a01869 \u00a00 13:28 ? \u00a0 \u00a0 \u00a0 \u00a000:00:00 \/opt\/mqm\/bin\/amqrrmfa -m QM_VER -t2332800 -s2592000 -p2592000 -g5184000 -c3600<\/tt><br \/>\n<tt>mqm \u00a0 \u00a0 \u00a0 1889 \u00a01869 \u00a00 13:28 ? \u00a0 \u00a0 \u00a0 \u00a000:00:00 \/opt\/mqm\/bin\/amqzdmaa -m QM_VER<\/tt><br \/>\n<tt>mqm \u00a0 \u00a0 \u00a0 1914 \u00a01869 \u00a00 13:28 ? \u00a0 \u00a0 \u00a0 \u00a000:00:00 \/opt\/mqm\/bin\/amqzmgr0 -m QM_VER<\/tt><br \/>\n<tt>mqm \u00a0 \u00a0 \u00a0 1928 \u00a01869 \u00a00 13:28 ? \u00a0 \u00a0 \u00a0 \u00a000:00:00 amqzlaa0 -mQM_VER -fip0<\/tt><br \/>\n<tt>rivera \u00a0 \u00a02484 19416 \u00a00 13:28 pts\/3 \u00a0 \u00a000:00:00 amqsput Q1 QM_VER<\/tt><br \/>\n<tt>rivera \u00a0 \u00a03605 19796 \u00a00 13:30 pts\/4 \u00a0 \u00a000:00:00 grep -i QM_VER<\/tt><\/p>\n<p>Because an amqsput connection is preventing the queue manager from terminating, only until amqsput terminates, the queue manager will end.<\/p>\n<p>One easy solution is to manually terminate amqsput, which will disconnect from the queue (OPPROCS will be 0) and the queue manager will terminate.<\/p>\n<p>However, sometimes, it is not easy to identify which is the particular application that is preventing the shutdown, then it is OK to escalate the shutdown of the queue manager by issuing &#8220;-i&#8221; (for immediate).<br \/>\nThus, in the same window or in another window, issue the following command, even though an &#8220;endmqm QMgrName&#8221; was issued already (but it is quiescing).<\/p>\n<p><tt>$ endmqm -i QM_VER<\/tt><br \/>\n<tt>WebSphere MQ queue manager 'QM_VER' ending.<\/tt><br \/>\n<tt>WebSphere MQ queue manager 'QM_VER' ended.<\/tt><\/p>\n<p>The &#8220;-i&#8221; flag will wait for in transit activities to terminate, but because there are none at this time, then it will terminate the connection of amqsput and then continue successfully to terminate the queue manager.<\/p>\n<p>Notice that the pending amqsput is terminated with rc 2009:<\/p>\n<p><tt>$ amqsput Q1 QM_VER<\/tt><br \/>\n<tt>Sample AMQSPUT0 start<\/tt><br \/>\n<tt>target queue is Q1<\/tt><br \/>\n<tt>MQCLOSE ended with reason code 2009<\/tt><br \/>\n<tt>Sample AMQSPUT0 end<\/tt><\/p>\n<p>Notice that the rc 2009 means:<br \/>\n<tt>$ mqrc 2009<\/tt><br \/>\n<tt>\u00a0 \u00a0 \u00a02009 \u00a00x000007d9 \u00a0MQRC_CONNECTION_BROKEN<\/tt><\/p>\n<\/div>\n<\/div>\n<div class=\"ibm-domino-rtf\"><\/div>\n<div class=\"ibm-container-body\">\n<h2 class=\" ibm-h4 ibm-bold\">Product Alias\/Synonym<\/h2>\n<p>WebSphere MQ WMQ<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p> Problem(Abstract) <\/p>\n<p>You notice that when the WebSphere MQ (WMQ) queue attributes of IPPROCS or OPPROCS are greater than 0, and try to end the queue manager by issuing &#8220;endmqm QmgrName&#8221;, then the queue manager goes into &#8220;quiescing&#8221; but it does not fully terminate.<\/p>\n<p>Is there a way to speed up the shutdown of the [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6488"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6488"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6488\/revisions"}],"predecessor-version":[{"id":6489,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6488\/revisions\/6489"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}