ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » How to prevent MQGMO_WAIT from cancelling during MQGET?

Post new topic  Reply to topic
 How to prevent MQGMO_WAIT from cancelling during MQGET? « View previous topic :: View next topic » 
Author Message
lyntongrice
PostPosted: Mon Nov 14, 2011 1:20 am    Post subject: How to prevent MQGMO_WAIT from cancelling during MQGET? Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

I am issuing an MQGET and would like to know under what circumstances the MQGET WAIT interval will cancel?

At the following URL it says:

http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqsao.doc%2Ffm12160_1.htm

"If the call is an MQGET call with the MQGMO_WAIT option, the wait has been canceled. All connection and object handles are now invalid."

So what would cause the wait step to terminate? Just a network issue? But I am running the application on the same box as MQ? I do push CTRL-C in the main application....so perhaps that interrups the current wait.....

I am just curious is there are any other options that would elegantly just make the MQGET fail? Reason I ask is that this wait step is getting cancelled and it is producing FDC's on the server that the MQ admin is not happy about....

BTW: This post is related to my other post http://www.mqseries.net/phpBB2/viewtopic.php?p=317402#317402
but is asking something a little different....

Thanks for the help

Lynton
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Nov 14, 2011 1:26 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

MQGMO_FAIL_IF_QUIESCING is one way to allow it to terminate, if the QM is being ended normally. Ending QM with -i will terminate it anyway.

If you terminate the process/thread that has issued the MQGET, then I am not surprised MQ is unhappy about it. It can hardly override the operating system.
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Mon Nov 14, 2011 2:20 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there, thanks for the response.....and yes, I agree...having a SIGNAL go to a thread in the background could very well upset the MQGET call that is busy in a WAIT step....

That is why I am using SIG_BLOCK etc now to hopefully get around it.....

Chat later

Lynton
Back to top
View user's profile Send private message
mvic
PostPosted: Mon Nov 14, 2011 3:18 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

lyntongrice wrote:
That is why I am using SIG_BLOCK etc now to hopefully get around it.....

I don't understand how that would help.
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Mon Nov 14, 2011 3:31 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Well if I have the MQGET thread running seperatly from the MAIN C thread and I tell that MQGET thread to ignore all signals I do think it would help....

My initial issue was when I hit CTRL-C and the main thread handles the shutdown hook to elegantly shutdown the MQGET thread etc, I am getting an MQRC_CONNECTION_BROKEN (2009) on the MQGET call that is currently running.....and that tells me "something happened when CTRL-C was hit" ......that is why I want to prevent any signals at all going to the "spawned thread"....

The queue manager is not stopping here....the CTRL-C (SIGINT) is causing something on the wait step on the MQGET to be interrupted......but interesting is on Linux and Solaris I have no issue......only on AIX......

Chat later
Back to top
View user's profile Send private message
mvic
PostPosted: Mon Nov 14, 2011 3:46 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

lyntongrice wrote:
The queue manager is not stopping here....the CTRL-C (SIGINT) is causing something on the wait step on the MQGET to be interrupted......but interesting is on Linux and Solaris I have no issue......only on AIX......

Signals during MQI calls (among other things on the same page):
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzal.doc/fg11970_.htm

For unthreaded:
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzal.doc/fg11920_.htm

For threaded:
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzal.doc/fg11930_.htm
Back to top
View user's profile Send private message
mvic
PostPosted: Mon Nov 14, 2011 3:48 am    Post subject: Re: How to prevent MQGMO_WAIT from cancelling during MQGET? Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

lyntongrice wrote:
Reason I ask is that this wait step is getting cancelled and it is producing FDC's on the server that the MQ admin is not happy about.

What is the header and MQM Function stack of the FDC?
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Mon Nov 14, 2011 4:41 am    Post subject: GET Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

Those signals and MQ calls are VERY handy....thanks a million!!

The FDC's etc are on another similar thread on this forum from me:

http://www.mqseries.net/phpBB2/viewtopic.php?p=317402#317402

I am now even more confused as to why my MQGET raises 2009 (MQRC_CONNECTION_BROKEN) on AIX when I issue CTRL-C on the main application.....MQ seems to handle signals fine......mmmmm
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Nov 14, 2011 5:53 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9470
Location: US: west coast, almost. Otherwise, enroute.

I'll ask the obvious questions:

Why do you issue a CTRL+C in the main application?

What did you think (expect, believe) would happen when you issue a CTRL+C in the main application?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 14, 2011 11:14 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Seems to me you have a design issue and a "runaway" application.
Let's say you have a foreground process that is starting a multithreaded background application, the question then is how do you control the background application?

Well the answer is somewhere else... You need to have a "server" app built that opens a port. Requests will be made to that port to retrieve a controller object. The requests on the controller object should then allow you to manipulate the background app. Note that the controller will need to keep a reference to the background app. So to start the background app you will need to start the controller and bootstrap it to the server....

In java you would have a name server and RMI calls...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Mon Nov 14, 2011 12:02 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9470
Location: US: west coast, almost. Otherwise, enroute.

Seems like this is a fundamental process-management design flaw.

Since the OP didn't offer much detail, I'm guessing that the main app MQCONNects to the qmgr, and then launches a child thread that does an MQGET.

The CTRL+C kills the parent process, leaving the child MQGET parent-less. The MQGET is not killed with a SIG. Rather, the orphaned MQGET call will be failed with r/c2009 because the parent with the connection handle no longer exists.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
mvic
PostPosted: Tue Nov 15, 2011 2:21 pm    Post subject: Re: GET Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

lyntongrice wrote:
Those signals and MQ calls are VERY handy....thanks a million!!

You are very welcome.

Quote:
The FDC's etc are on another similar thread on this forum from me:

http://www.mqseries.net/phpBB2/viewtopic.php?p=317402#317402

Thank you. I have just added a comment in that other thread.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Wed Nov 16, 2011 3:43 am    Post subject: Re: How to prevent MQGMO_WAIT from cancelling during MQGET? Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

lyntongrice wrote:
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqsao.doc%2Ffm12160_1.htm

"If the call is an MQGET call with the MQGMO_WAIT option, the wait has been canceled. All connection and object handles are now invalid."

So what would cause the wait step to terminate?

There was a sentence or two before that:
Quote:
Connection to the queue manager has been lost. ... If the call is an MQGET call with the MQGMO_WAIT option, the wait has been canceled.

The connection to the queue manager has been lost. That would cause the wait step to terminate.

The application needs to execute the following steps in order:
  1. wait for the MQGET to complete
  2. close the queue
  3. disconnect from the qmgr
If the main thread disconnects from the queue manager while the MQGET is still in progress, that would cause the MQGET to abend with a MQRC_CONNECTION_BROKEN error.

lyntongrice wrote:
I am using SIG_BLOCK etc now to hopefully get around it ... I tell that MQGET thread to ignore all signals ...

Block is not the same as ignore.

lyntongrice wrote:
My initial issue was when I hit CTRL-C and the main thread handles the shutdown hook to elegantly shutdown the MQGET thread

Which thread handles the close and disconnect? Is that before or after the MQGET completes?
Back to top
View user's profile Send private message
mvic
PostPosted: Wed Nov 16, 2011 3:51 am    Post subject: Re: How to prevent MQGMO_WAIT from cancelling during MQGET? Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

rekarm01 wrote:
Which thread handles the close and disconnect?

The OP's other forum thread shows that the app was linked with libmqm when it should (because it uses threads) be using libmqm_r. IMHO all bets are off until that program is rebuilt correctly.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » How to prevent MQGMO_WAIT from cancelling during MQGET?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.