https://issues.apache.org/bugzilla/show_bug.cgi?id=49343

           Summary: AbstractReplicatedMap is not removed from channel.
           Product: Tomcat 7
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Cluster
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: kfuj...@apache.org


AbstractReplicatedMap#init() is as follows.
=====
protected void init(....) {

    ...skip...
    this.rpcChannel = new RpcChannel(this.mapContextName, channel, this);
    //add this map as a message listener
    this.channel.addChannelListener(this);
    //listen for membership notifications
    this.channel.addMembershipListener(this);

    try {
        //broadcast our map, this just notifies other members of our existence
        broadcast(MapMessage.MSG_INIT, true);
        //transfer state from another map
        transferState();
        //state is transferred, we are ready for messaging
        broadcast(MapMessage.MSG_START, true);
    } catch (ChannelException x) {
        log.warn("Unable to send map start message.");
        throw new RuntimeException("Unable to start replicated map.",x);
    }
}
=====

When ChannelException is thrown after this(AbstractReplicatedMap) is added to
channel, 
RuntimeException is thrown.
And AbstractReplicatedMap#init() is called from the constructor of 
AbstractReplicatedMap(LazyReplicatedMap or ReplicatedMap). 

In a word, no one can remove this(AbstractReplicatedMap) added to channel.

As a result, trivial memory leak and IllegalArgumentException("Listener already
exists:...) are caused. 


Best regards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to