Re: [jgroups-dev] message passing up is broken in NAKACK

Bela Ban <[email protected]> Mon, 20 May 2013 17:40:18 +0200
Newsgroups gmane.comp.java.javagroups.devel
Message-ID <[email protected]>
Yes, you should not reuse a Message instance. I'll make sure to update 
the docs. Actually, I think I have, but haven't yet pushed the docs out 
to the website (will do that tomorrow).

I think it's a bad idea to invoke castMessage() multiple times. JGroups 
does do retransmission, and invoking the RPC multiple times adds to the 
message traffic.

Instead, I'd set a timeout for the call and take corrective action if 
not everybody received a message. Usually, those members are faulty and 
will be removed from the view anyway.

On 5/20/13 8:47 AM, hyliu wrote:
> I think I already know the reason.
>
> I have a retry logic in cast message, dummy code is like below, I need a
> synch call here, i.e. hold untill all other node get this message.
>
> RspList l = dispacher_.castMessage(..., msg, ...);
> while (l.notAllRreceived()){
>      l = dispacher_.castMessage(..., msg, ...);
> }
>
> and I used same msg object.
>
> in the first time cast message, for some reason, msg fail to get response
> within timeout duration. then I retried, this time the seqno in msg get
> updated in NAKACK.send method, (say from seqno1 to seqno2). while in
> NakReceiverWindow.xmit_table, the seqno key doesn't get change (now
> xmit_table contains two records, seqno1 -> msg, seqno2 -> msg, both msg are
> same object, the seqno in NakAckHeader are seqno2). then on handleXmitReq,
> xmit request ask for seqno1, and the msg seqno in xmit_table's NakAckHeader
> is seqno2. so this msg send to another node become a unexpect msg.
>
> so complex, it takes up me 3 days to dig out the reason. may be it need put
> an item in doc, one message object should not be sent multiple times.
>
> after change to use a new msg object on retry, this issue seems gone.


-- 
Bela Ban, JGroups lead (http://www.jgroups.org)

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Javagroups-development mailing list