[jboss-jira] [JBoss JIRA] (JGRP-2454) Documentation is wrong for ForkChannel creation / Initial messages on fork channel are lost

Bela Ban (Jira) issues at jboss.org
Mon Mar 9 10:04:22 EDT 2020


    [ https://issues.redhat.com/browse/JGRP-2454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13992562#comment-13992562 ] 

Bela Ban commented on JGRP-2454:
--------------------------------

I changed the manual for 4.x and 5. The main channel must be connected when connecting the ForkChannel, so I reversed the 2 lines in question. Note that ForkChannelTest does this correctly.

Sending messages in {{viewAccepted()}} is not really an anti-pattern, but not recommended, either. Say you're installing view \{\{A,B,C,D\}\}: not everybody may install this new view at exactly the same time, e.g. if C install it with a delay, then the message from D will be discarded as D is not yet a member of C's (old) view. This applies to both regular and fork channels.
 



> Documentation is wrong for ForkChannel creation / Initial messages on fork channel are lost
> -------------------------------------------------------------------------------------------
>
>                 Key: JGRP-2454
>                 URL: https://issues.redhat.com/browse/JGRP-2454
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 4.1.8
>            Reporter: Mirko Streckenbach
>            Assignee: Bela Ban
>            Priority: Minor
>             Fix For: 5.0, 4.2.1
>
>
> The documentation at 
> http://www.jgroups.org/manual/html/user-advanced.html#ForkChannelCreation
> has the following example:
> {code}
> JChannel main_ch=new JChannel("/home/bela/udp.xml").name("A");
> ForkChannel fork_ch=new ForkChannel(main_ch, "lock", "fork-ch4",
>                                     new CENTRAL_LOCK(), new STATS());
> fork_ch.connect("bla");
> main_ch.connect("cluster");
> {code}
> This does not work as "fork_ch.connect" will throw an IllegalStateException because the main channel is not connected at that point.
> But if the connects are reversed, messages for the fork channel may arrive before the fork channel is fully established and cause warnings like
> {code}
> Feb 20, 2020 6:15:37 PM org.jgroups.protocols.FORK$1 handleUnknownForkChannel
> WARNING: marian-20309: fork-channel for id=fork-ch4 not found; discarding message
> {code}
> My application will send a message to every new member in the cluster on a specific fork channel (in  ReceiverAdapter.viewAccepted). These message usually get lost. Is there an alternate pattern for that?
> I can provide example code if required.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list