[jboss-jira] [JBoss JIRA] (JGRP-1835) DONT_LOOPBACK flag causes credit exhaustion in MFC

Bela Ban (JIRA) issues at jboss.org
Thu May 8 09:09:56 EDT 2014


    [ https://issues.jboss.org/browse/JGRP-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966436#comment-12966436 ] 

Bela Ban edited comment on JGRP-1835 at 5/8/14 9:09 AM:
--------------------------------------------------------

As a matter of fact, the small program below shows the issue:
* Multicast messages are sent by P
* P stores them in the retransmission table for P
* The transport drop's P's messages
* Messages accumulate in the retransmission table for P
* When a multicast message from P is received that's not marked as {{DONT_LOOPBACK}} (e.g. a {{VIEW}}), all messages in the retransmission table for P are removed and delivered
** Messages marked as {{DONT_LOOPBACK}} are discarded

{code:java}
public class bla2 {
    protected JChannel ch;

    protected void start(String name) throws Exception {
        ch=new JChannel().name(name);
        ch.setReceiver(new ReceiverAdapter() {
            public void receive(Message msg) {
                System.out.println("from " + msg.src() + ": " + msg.getObject());
            }
        });
        ch.connect("cluster");
        int cnt=1;
        while(true) {
            if(Util.keyPress(cnt + ":") == 'x')
                break;
            Message msg=new Message(null, cnt++)
                    .setTransientFlag(Message.TransientFlag.DONT_LOOPBACK);
            ch.send(msg);
        }
        Util.close(ch);
    }

    public static void main(String[] args) throws Exception {
       new bla2().start(args[0]);
    }
}
{code}


was (Author: belaban):
As a matter of fact, the small program below shows the issue:
* Multicast messages are sent by P
* P stores them in the retransmission table for P
* The transport drop's P's messages
* Messages accumulate in the retransmission table for P
* When a multicast message from P is received that's not marked as {{DONT_LOOPBACK}} (e.g. a {{VIEW}}), all messages in the retransmission table for P are removed and delivered
** This actually defies the purpose (P should never receive messages marked as {{DONT_LOOPBACK}} !

{code:java}
public class bla2 {
    protected JChannel ch;

    protected void start(String name) throws Exception {
        ch=new JChannel().name(name);
        ch.setReceiver(new ReceiverAdapter() {
            public void receive(Message msg) {
                System.out.println("from " + msg.src() + ": " + msg.getObject());
            }
        });
        ch.connect("cluster");
        int cnt=1;
        while(true) {
            if(Util.keyPress(cnt + ":") == 'x')
                break;
            Message msg=new Message(null, cnt++)
                    .setTransientFlag(Message.TransientFlag.DONT_LOOPBACK);
            ch.send(msg);
        }
        Util.close(ch);
    }

    public static void main(String[] args) throws Exception {
       new bla2().start(args[0]);
    }
}
{code}

> DONT_LOOPBACK flag causes credit exhaustion in MFC
> --------------------------------------------------
>
>                 Key: JGRP-1835
>                 URL: https://issues.jboss.org/browse/JGRP-1835
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 3.5
>            Reporter: Bela Ban
>            Assignee: Bela Ban
>             Fix For: 3.5
>
>
> When a message M is multicast by sender P and has the {{DONT_LOOPBACK}} transient flag set, it will not get looped back up the stack.
> When M passes MFC on the way down, it decrements the sent credits for P. When M is received by P, the received credits are decrements and possibly credits are sent back to P.
> However, M is *never received by P* because {{DONT_LOOPBACK}} causes it to be dropped.
> This results in credits for P getting exhausted if we send many messages. Credit requests sent by P (every 5 s by default) do replenish P's credits, but if P sends many messages this is not enough, and slows things down.
> SOLUTION:
> # Don't use {{DONT_LOOPBACK}} in upper protocols or application space. JGroups itself uses it for discovery (lower protocols)
> # Don't maintain credits for self; ie. P doesn't decrement or replenish credits for itself, only for others
> #* Make sure P doesn't starve processing of messages from all other members (who use flow control) by circumventing flow control...
> # When sending a message tagged as {{DONT_LOOPBACK}}, decrement the *received* credits immediately and send new credits if needed



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the jboss-jira mailing list