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 » Confusion over Heartbeat

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 Confusion over Heartbeat « View previous topic :: View next topic » 
Author Message
mqrules
PostPosted: Wed Nov 11, 2009 10:41 am    Post subject: Confusion over Heartbeat Reply with quote

Centurion

Joined: 01 Jun 2005
Posts: 100
Location: US

Hi,

We have an argument regarding the purpose of the use of HBINT. The manual says:
Quote:
You can specify the approximate time between heartbeat flows that are to be passed from a sending MCA when there are no messages on the transmission queue. Heartbeat flows unblock the receiving MCA, which is waiting for messages to arrive or for the disconnect interval to expire. When the receiving MCA is unblocked it can disconnect the channel without waiting for the disconnect interval to expire. Heartbeat flows also free any storage buffers that have been allocated for large messages and close any queues that have been left open at the receiving end of the channel.



To me, it means that when a heartbeat is sent it will unblock the waiting receving MCA which will DISONNECT the channel without waiting for the DISCINT to kick in. That is why HBINT should be considerably smaller than DiconnectInterval. But some people argue that Heartbeat flows actually keep the channel "alive" by telling the other side of the channel that it is still running. Any feedback from the MQ gurus?

Thanks.
MRule
Back to top
View user's profile Send private message
shashivarungupta
PostPosted: Wed Nov 11, 2009 10:50 am    Post subject: Reply with quote

Grand Master

Joined: 24 Feb 2009
Posts: 1343
Location: Floating in space on a round rock.

I got another question on your question, that might help you, 'what do you understand by the blocking and unblocking of the channel MCA' ?

_________________
*Life will beat you down, you need to decide to fight back or leave it.
Back to top
View user's profile Send private message Send e-mail
mqrules
PostPosted: Wed Nov 11, 2009 11:15 am    Post subject: Reply with quote

Centurion

Joined: 01 Jun 2005
Posts: 100
Location: US

Sashivurangupta
Quote:
I got another question on your question, that might help you, 'what do you understand by the blocking and unblocking of the channel MCA' ?

When a channel sender/receiver pair is started but
idle, the sender MCA is waiting for an MQGET from the transmission
queue, and the receiver MCA is blocked, waiting for a socket receive
call. The socket receive call is analogous to an MQGET call in that a
wait period can be specified, and execution is blocked until either
some data arrives or the wait period expires.
When a channel is idle (let’s assume channel heartbeats are disabled
the MCAs do not send or receive any data and each MCA will be unaware of the opposite MCA’s status. In the case of a communications error, such as a network outage, the sender will be unaware that the receiver is
unavailable until a message arrives on the transmission queue and it
tries to send, over the socket, to the receiver MCA. The sender MCA
will receive an error only when it tries to send data. Furthermore, the
receiver MCA will not normally be aware that the sender is unavailable
as it simply may not be sending any data.

So, this being the case, sending a hearbeat is SDR's way of telling the RCVR MCA that it has no messages to send and it (the RCVR) can go head and unblock itself and "disconnect the channel without waiting for the disconnect interval to expire."

MRule
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Nov 11, 2009 11:24 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

mqrules wrote:
So, this being the case, sending a hearbeat is SDR's way of telling the RCVR MCA that it has no messages to send and it (the RCVR) can go head and unblock itself and "disconnect the channel without waiting for the disconnect interval to expire."



Study this document:
http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24006699&loc=en_US&cs=utf-8&lang=en

It does not matter that it was written for MQ 5.3. It applies to MQ 6 and 7.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
mqrules
PostPosted: Wed Nov 11, 2009 11:48 am    Post subject: Reply with quote

Centurion

Joined: 01 Jun 2005
Posts: 100
Location: US

Peter,

Thanks...

I like MD0C and refer to it when quite often . It confirms my understanding too when it says:
Quote:
This heartbeat is actually a short message sent to the receiving MCA (or CLNTCONN during MQGET)
to check that it is still available. It is only sent when there is no other activity on the channel for at least
Heartbeat seconds. These messages solve two problems; sender MCAs may now get an immediate
error return from the network, instead of sitting on their MQGET; and they also allow receiver MCAs to
do some processing such as checking for the termination of the queue manager before sending their
response.
Additionally, since the channel is not transferring messages regularly the channel chooses not to
maintain its cache of storage and Queues. So, at heartbeat time a channel will also free any
unnecessary storage buffers and message areas and close any cached queues.


Regards.

MRule
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Nov 11, 2009 12:03 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Heartbeats do NOT cause a running channel to shutdown before DISCINT. Heartbeats do keep the channel alive.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
shashivarungupta
PostPosted: Wed Nov 11, 2009 12:33 pm    Post subject: Reply with quote

Grand Master

Joined: 24 Feb 2009
Posts: 1343
Location: Floating in space on a round rock.

Agree !! It is a Good one. MD0C
No doubt !!
_________________
*Life will beat you down, you need to decide to fight back or leave it.
Back to top
View user's profile Send private message Send e-mail
mqrules
PostPosted: Wed Nov 11, 2009 1:36 pm    Post subject: Reply with quote

Centurion

Joined: 01 Jun 2005
Posts: 100
Location: US

Peter,

it is not me but the IBM manual that says (and I copy & paste here):
Quote:
Heartbeat flows unblock the receiving MCA, which is waiting for messages to arrive or for the disconnect interval to expire. When the receiving MCA is unblocked it can disconnect the channel without waiting for the disconnect interval to expire. Heartbeat flows also free any storage buffers that have been allocated for large messages and close any queues that have been left open at the receiving end of the channel


I don't understand how we reach two different conclusions from the above statement. Hmmmm....

Regards,
MRule
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Nov 11, 2009 2:16 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Study pages 17-20 of the MD0C Support Pack.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Wed Nov 11, 2009 2:29 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

Quote:
...This heartbeat is actually a short message sent to the receiving MCA (or CLNTCONN during MQGET) to check that it is still available....


Note that with MQ v7 client to MQ v7 server, with SHARECNV > 0, the heartbeats are sent from both the MCAs at CLNTCONN end and SVRCONN end of the channel, irrespective of any MQGET in progress. Heartbeats allow earlier detection of network and channel problems.
_________________
Glenn
Back to top
View user's profile Send private message
mqrules
PostPosted: Wed Nov 11, 2009 4:57 pm    Post subject: Reply with quote

Centurion

Joined: 01 Jun 2005
Posts: 100
Location: US

Peter,

I have read and re-read and re-read MD0C....

I agree with the statements made in the MD0C and the Intercommunication manual. Probably you and I are re-wording our understanding a little differently. Yes, Heartbeats serve two purposes: 1- To keep the channels alive --i.e. a mechanisim to check if the Receiving side MCA (RCVR chl or CLNTCONN in MQGET withWAIT) is still available AND 2- To tell the receiving MCA that there is NO msgs to send on the xmit queue so that the receiver, and I quote from the Intercommunication Manual:
Quote:
....so that when there are no messages on the transmission queue, the sending MCA will send a heartbeat flow to the receiving MCA, thus giving the receiving MCA an opportunity to quiesce the channel without waiting for the disconnect interval to expire


Thanks for your response anyway... Much appreciated .

Regards
MRule
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Nov 11, 2009 6:16 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

A running RCVR MCA is just sitting there on the TCP socket waiting for another MQ message to be sent by the partner SNDR MCA. The RCVR MCA doesn't know when the next message will arrive. So it sits there, waiting, and waiting, and waiting. If no messages arrive and DISCINT expires, the RCVR MCA gracefully ends and is available to be restarted the next time the SNFD channel restarts.

But what if you have DISCINT set to a really big number like 1 month, or worse yet 0? (*see below) In this case the RCVR channel will wait forever. Now imagine that during a period of waiting there is a communication break between the sender and the receiver. The SNDR channel will be OK - the next time it tries to send another message it will notice the break, drop into retry and keep retrying. Meanwhile on the RCVR side, that RCVR MCA is just sitting there, waiting and waiting and waiting. It never knows that there is a break. Finally connectivity is established between the 2 sides. The SNDR tries to connect and finds...the RCVR still hung up on the orphaned TCP socket. Not good! This is where AdoptNewMCA saves the day.

But, you can avoid that situation. If you are using heartbeats, both the SNDR and the RCVR know the frequency of when the next heartbeat should arrive. When the RCVR MCA notices that expected heartbeats are not arriving, it realizes that there is a problem, ends itself and becomes ready for a reconnect. It doesn't waste time and resources waiting until DISCINT goes by, hung up on an orphaned TCP socket and hoping that the MQ Admin had the brains to use AdoptNewMCA properly.

The presence of heartbeats keeps a channel running up to its DISCINT.
The lack of expected heartbeats allows a RCVR MCA to end.
This is in addition to the other good stuff that heartbeats allow as described in the manuals and the support packs.
Heartbeats are tiny (I think they are like 12 bytes if I remember) and there should be no reason not to use them. And AdoptNewMCA. And smaller rather than bigger DISCINT.


* Now you know yet another reason why really big DISCINTs and especially 0 for DISCINT are generally bad.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
mqrules
PostPosted: Fri Nov 13, 2009 3:16 pm    Post subject: Reply with quote

Centurion

Joined: 01 Jun 2005
Posts: 100
Location: US

Peter,

Thanks for the long explanation. Are you saying that the two-fold purpose of the Hearbeats is NOT documented correctly in the Intercommuncation manual?
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Nov 13, 2009 4:20 pm    Post subject: Reply with quote

Poobah

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

Quote:
two-fold purpose of the Heartbeats is NOT documented correctly in the Intercommuncation manual?

Both heartbeat functions (disconnect to release resources, and ending orphaned MCA) are described in the Intercommunications manual; but not as briefly and concisely as Mr. Potkay has done here.

You have discovered one of the hazards of reading just one portion of a manual, and presuming that what you have read is the all-encompassing truth. Truth comes from reading and rereading all relevant documentation (including posts here), IBM's ptf and apar doc, and discovery through experimentation. These take time.
Quote:

Now imagine that during a period of waiting there is a communication break between the sender and the receiver.

This scenario can be tested with an inexpensive pair of scissors, or, my favorite, a back-hoe.
_________________
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
jcv
PostPosted: Tue Nov 17, 2009 2:29 am    Post subject: Reply with quote

Chevalier

Joined: 07 May 2007
Posts: 411
Location: Zagreb

Peter, if really big DISCINTs are just generally bad, then probably there are good reasons to use them, as oposed to general statement?
But since you said there should be no reason not to use smaller rather than bigger DISCINTs, wouldn't it be reasonable to make sure there is no reason to use bigger rather than smaller DISCINTs, and remove (revoke) that option?
Because, this sounds a bit like it is absolutely bad choice under any circumstances.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » General IBM MQ Support » Confusion over Heartbeat
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.