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 » Comment in MO01 about gmo.WaitInterval = MQWI_UNLIMITED

Post new topic  Reply to topic
 Comment in MO01 about gmo.WaitInterval = MQWI_UNLIMITED « View previous topic :: View next topic » 
Author Message
sotoka
PostPosted: Fri Feb 10, 2006 1:44 pm    Post subject: Comment in MO01 about gmo.WaitInterval = MQWI_UNLIMITED Reply with quote

Novice

Joined: 05 Feb 2006
Posts: 12

Hello,
while reading the source code of evmon.c from MO01
I've stumbled across this comment
/****************************************************************/
/* we used to have this as unlimited wait but we can't do */
/* this because if it's done from a client and the client dies */
/* then the server doesn't notice and keeps the queue open */
/* so now we loop on a 5 second wait */
/****************************************************************/
/*gmo.WaitInterval = MQWI_UNLIMITED; no time limit */
gmo.WaitInterval = 5000; /* 5 seconds */

What exactly are the implications of "queue being open"? Open by whom?
The client dies, so what keeps the queue in "open state"?

I understand that there's a Heartbeat attribute which allows channel
to be taken down when the clients dies, but I didn't know (so far :-) that
there's a possibility of keeping queues open when the client ends
the connection unexpectedly...

thanks,
So
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Feb 10, 2006 2:04 pm    Post subject: Re: Comment in MO01 about gmo.WaitInterval = MQWI_UNLIMITED Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

If a client / server connection breaks, the queue manager will not be informed by TCP/IP until the keepalive interval expires. This can be hours. In this time, the queue manager keeps resources in use for the connection, including any open Q handles. The answer to this problem is to use keepalive on TCP/IP. And tune keepalives to be of an acceptable frequency - which is (I think) is done in different ways on different operating systems.

Search this forum for keepalive and/or check out this document: http://www.ibm.com/support/docview.wss?uid=swg24006699

EDIT: add a bit to the first paragraph


Last edited by mvic on Fri Feb 10, 2006 5:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Feb 10, 2006 2:48 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Keep Alive will help, but for MQClients in a MQGET with Wait, so will Heartbeats.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Feb 10, 2006 3:04 pm    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

PeterPotkay wrote:
Keep Alive will help, but for MQClients in a MQGET with Wait, so will Heartbeats.

Absolutely true. The question, though, was about broken connections or prematurely terminating client programs
Back to top
View user's profile Send private message
sotoka
PostPosted: Sat Feb 11, 2006 3:31 am    Post subject: Re: Comment in MO01 about gmo.WaitInterval = MQWI_UNLIMITED Reply with quote

Novice

Joined: 05 Feb 2006
Posts: 12

Okay, guys. Thanks for an ultra-quick annswer and hints!
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Sat Feb 11, 2006 8:44 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

mvic wrote:
PeterPotkay wrote:
Keep Alive will help, but for MQClients in a MQGET with Wait, so will Heartbeats.

Absolutely true. The question, though, was about broken connections or prematurely terminating client programs


Right, I guess I was focusing on the faulty logic in that comment:

Code:

/* we used to have this as unlimited wait but we can't do */
/* this because if it's done from a client and the client dies */
/* then the server doesn't notice and keeps the queue open */
/* so now we loop on a 5 second wait */
/*********************************************************/
/*gmo.WaitInterval = MQWI_UNLIMITED; no time limit */
gmo.WaitInterval = 5000; /* 5 seconds */

They accomplished nothing by looping, other than chewing up CPU cycles. If the concern was for things going bad during along Get with wait, I wanted sotoka to be aware that that is the one time that Heartbeats are flowing for an MQClient, and it would notify the QM the other side is gone.

Yes, so will Keep Alive, but typically Keep Alive is set to 5 minutes or 15 minutes, or left at he default of 2 hours, whereas HBs are usually and safely set to something smaller, and so will "kick in" sooner in this scenario.

Bottom line, you should use both, both will save the orphaned connection issue, and that comment should be removed from the program, its misleading.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Mon Feb 13, 2006 4:47 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

mquseless wrote:
Quote:
They accomplished nothing by looping, other than chewing up CPU cycles


I do not agree.
The 5 second interval will cause a new flow to travel to the server every 5 seconds, and act like a heartbeat. There is more chance of discovering a network problem the more times the app calls send() or recv(). Just waiting in a recv() as it would do if the wait interval were unlimited is less likely to get a bad TCP return code.

That will allow the CLIENT to realize there is a problem.
It does nothing for the Queue manager, which is what they are referring to in the comment:
Quote:

/* then the server doesn't notice and keeps the queue open */

But if you use HBs, then both sides will know if there is a problem during a long get with wait.
_________________
Peter Potkay
Keep Calm and MQ On
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 » Comment in MO01 about gmo.WaitInterval = MQWI_UNLIMITED
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.