Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-M3
    • Component/s: Core
    • Labels:
      None

      Description

      For supporting multicast over UDP we need to change the MINA API for
      Set the multicast Time to Live (TTL) for a multicast transmission.
      Joining a multicast group for a given session.
      Leaving a multicast group.

      1. diff.txt
        15 kB
        Jan S. Rellermeyer
      2. diff_apr.txt
        2 kB
        Lorenz Breu
      3. AprDatagramConnector.java
        11 kB
        Lorenz Breu
      4. AprDatagramAcceptor.java
        18 kB
        Lorenz Breu

        Activity

        Hide
        Emmanuel Lecharny added a comment -

        Postponed to 3.0

        Show
        Emmanuel Lecharny added a comment - Postponed to 3.0
        Emmanuel Lecharny made changes -
        Fix Version/s 3.0.0-M3 [ 12328542 ]
        Fix Version/s 2.0.8 [ 12323342 ]
        Emmanuel Lecharny made changes -
        Fix Version/s 2.0.8 [ 12323342 ]
        Fix Version/s 2.0.6 [ 12316652 ]
        Hide
        Alex C added a comment -

        What is the likely date for MINA Multicast support?

        Show
        Alex C added a comment - What is the likely date for MINA Multicast support?
        Julien Vermillard made changes -
        Fix Version/s 2.0.6 [ 12316652 ]
        Fix Version/s 3.0.0-M1 [ 12313531 ]
        Hide
        Lorenz Breu added a comment -

        Yeah, sorry about that. That's just the way I started: copy, paste, adjust. Thought I would have to make a lot more changes. Anyway, I was in a hurry and was happy once it worked for my main project (jSLP).

        Show
        Lorenz Breu added a comment - Yeah, sorry about that. That's just the way I started: copy, paste, adjust. Thought I would have to make a lot more changes. Anyway, I was in a hurry and was happy once it worked for my main project (jSLP).
        Hide
        Julien Vermillard added a comment -

        Need to check if tomcat-native guys can push us a version with the fix in the repo, could be convenient.
        On the patch itself the AprDatagramAcceptor is a copy/paste of the SocketAcceptor, we need to find a way to have the classes sharing more code.

        Show
        Julien Vermillard added a comment - Need to check if tomcat-native guys can push us a version with the fix in the repo, could be convenient. On the patch itself the AprDatagramAcceptor is a copy/paste of the SocketAcceptor, we need to find a way to have the classes sharing more code.
        Lorenz Breu made changes -
        Attachment diff_apr.txt [ 12404754 ]
        Attachment AprDatagramAcceptor.java [ 12404755 ]
        Attachment AprDatagramConnector.java [ 12404756 ]
        Hide
        Lorenz Breu added a comment -

        OK, here are the changes I made:
        diff_apr.txt contains the changes I made to AprSession, and the other two files are new.

        The Acceptor and Connector require the latest version of tomcat-native, as 1.1.15 and even early 1.1.16 had a bunch of typos. I deployed a fixed version in my local mvn repo to use my MINA transport-apr classes.

        Show
        Lorenz Breu added a comment - OK, here are the changes I made: diff_apr.txt contains the changes I made to AprSession, and the other two files are new. The Acceptor and Connector require the latest version of tomcat-native, as 1.1.15 and even early 1.1.16 had a bunch of typos. I deployed a fixed version in my local mvn repo to use my MINA transport-apr classes.
        Hide
        Lorenz Breu added a comment -

        probably not.
        i think i "hacked" a fixed version of tomcat native ( i think it's
        called tomcat-apr) into my local repo... tomcat native has been fixed
        officially since i did that, but i have no idea how they integrate with
        all the other stuff and whether they commit to the mvn repo or not...

        Show
        Lorenz Breu added a comment - probably not. i think i "hacked" a fixed version of tomcat native ( i think it's called tomcat-apr) into my local repo... tomcat native has been fixed officially since i did that, but i have no idea how they integrate with all the other stuff and whether they commit to the mvn repo or not...
        Hide
        Julien Vermillard added a comment -

        hmm at first look, tomcat-apr 5.5.23.1 isn't in the mvn repository

        Show
        Julien Vermillard added a comment - hmm at first look, tomcat-apr 5.5.23.1 isn't in the mvn repository
        Julien Vermillard made changes -
        Assignee Julien Vermillard [ vrm ]
        Hide
        Julien Vermillard added a comment -

        you should open a separate issue for the mem-leak problem.

        For windows multicast joining, the problem is probably deeper, in APR surely.

        Show
        Julien Vermillard added a comment - you should open a separate issue for the mem-leak problem. For windows multicast joining, the problem is probably deeper, in APR surely.
        Hide
        Lorenz Breu added a comment - - edited
        • currently only unicast is being used by said server.
        • I will try to get some snapshots later, right now I just don't have the time.
        • on a side note: i cannot get the AprDatagramAcceptor to join multicast groups under windows, although all calls to tomcat native and apr return APR_SUCCESS... the same code on the same machine booted to linux however works fine
        Show
        Lorenz Breu added a comment - - edited currently only unicast is being used by said server. I will try to get some snapshots later, right now I just don't have the time. on a side note: i cannot get the AprDatagramAcceptor to join multicast groups under windows, although all calls to tomcat native and apr return APR_SUCCESS... the same code on the same machine booted to linux however works fine
        Hide
        Emmanuel Lecharny added a comment -

        It would be interesting to get some YourKit memory snapshots to be able to determinate which objects are being 'lost'...

        Show
        Emmanuel Lecharny added a comment - It would be interesting to get some YourKit memory snapshots to be able to determinate which objects are being 'lost'...
        Hide
        Julien Vermillard added a comment -

        prolly linked to APR than to multicast, same behavior in unicast ?

        Show
        Julien Vermillard added a comment - prolly linked to APR than to multicast, same behavior in unicast ?
        Hide
        Lorenz Breu added a comment -

        During extensive load tests against a server based on my AprDatagramAcceptor I noticed that after receiveing about 6 or 7 million messages, the OS would kill java due to lack of memory. I therefor suspect a memory leak either in my MINA code or else the underlying tomcat-jni or apr code.

        Show
        Lorenz Breu added a comment - During extensive load tests against a server based on my AprDatagramAcceptor I noticed that after receiveing about 6 or 7 million messages, the OS would kill java due to lack of memory. I therefor suspect a memory leak either in my MINA code or else the underlying tomcat-jni or apr code.
        Jan S. Rellermeyer made changes -
        Attachment diff.txt [ 12399121 ]
        Hide
        Jan S. Rellermeyer added a comment -

        patch

        Show
        Jan S. Rellermeyer added a comment - patch
        Hide
        Jan S. Rellermeyer added a comment -

        Lorenz Breu has implemented a multicast support based on APR and Tomcat-Native. The patch follows. Currently, the patch depends on bug tomcat-native #46457 to be fixed.

        Show
        Jan S. Rellermeyer added a comment - Lorenz Breu has implemented a multicast support based on APR and Tomcat-Native. The patch follows. Currently, the patch depends on bug tomcat-native #46457 to be fixed.
        Emmanuel Lecharny made changes -
        Fix Version/s 3.0.0-M1 [ 12313531 ]
        Hide
        Emmanuel Lecharny added a comment -

        Postponed to 3.0

        Show
        Emmanuel Lecharny added a comment - Postponed to 3.0
        Hide
        Lorenz Breu added a comment - - edited

        Hey thanks! I didn't see the org.apache.mina.transport.socket.apr package in Eclipse, now I do. A quick overview suggests that extending AprSocketAcceptor using the class "Multiclass" from the jni library might lead to results.
        Otherwise I guess I will have to use the MulticastSocket provided by java.net to implement a new IoAcceptor, however after only a few hours on this project I still have no idea how APR, MINA, NIO and co. actually work, so I will fight my way through some code and look into it.

        Show
        Lorenz Breu added a comment - - edited Hey thanks! I didn't see the org.apache.mina.transport.socket.apr package in Eclipse, now I do. A quick overview suggests that extending AprSocketAcceptor using the class "Multiclass" from the jni library might lead to results. Otherwise I guess I will have to use the MulticastSocket provided by java.net to implement a new IoAcceptor, however after only a few hours on this project I still have no idea how APR, MINA, NIO and co. actually work, so I will fight my way through some code and look into it.
        Hide
        Julien Vermillard added a comment -

        Hi,
        Quick resume, two wayo to implements multicast :

        • use NIO2, (jdk1.7) wich is supposed to support multicast
        • use APR transport which is half finished, but is supporting multicast
          NIO actually lack support for multicast
        Show
        Julien Vermillard added a comment - Hi, Quick resume, two wayo to implements multicast : use NIO2, (jdk1.7) wich is supposed to support multicast use APR transport which is half finished, but is supporting multicast NIO actually lack support for multicast
        Hide
        Lorenz Breu added a comment -

        It seems as though this issue has not been touched since November 07. I have just started my MSc thesis and will be working on apache Directory and MINA among other things. My first task, so to speak, is to add multicast support to MINA. Has anyone been doing any work on this lately?

        Show
        Lorenz Breu added a comment - It seems as though this issue has not been touched since November 07. I have just started my MSc thesis and will be working on apache Directory and MINA among other things. My first task, so to speak, is to add multicast support to MINA. Has anyone been doing any work on this lately?
        Hide
        Julien Vermillard added a comment -

        I agree the API impact will be minimal, I think we can do it when I block some time for finishing APR support.

        Show
        Julien Vermillard added a comment - I agree the API impact will be minimal, I think we can do it when I block some time for finishing APR support.
        Trustin Lee made changes -
        Fix Version/s 2.0.0-M1 [ 12312171 ]
        Trustin Lee made changes -
        Field Original Value New Value
        Priority Critical [ 2 ] Minor [ 4 ]
        Hide
        Trustin Lee added a comment -

        OK... To summarize the discussion so far, it seems like this issue doesn't impact the core API but add some methods and classes and that's all. Let me adjust the priority of this issue and reschedule it. I think it's not mandatory to resolve this issue in 2.0.0-M1 for the current situation that we don't even have any working multicast transport.

        Show
        Trustin Lee added a comment - OK... To summarize the discussion so far, it seems like this issue doesn't impact the core API but add some methods and classes and that's all. Let me adjust the priority of this issue and reschedule it. I think it's not mandatory to resolve this issue in 2.0.0-M1 for the current situation that we don't even have any working multicast transport.
        Show
        Trustin Lee added a comment - JGroups code: http://javagroups.cvs.sourceforge.net/javagroups/JGroups/src/org/jgroups/protocols/UDP.java?revision=1.156&view=markup It seems like IoAcceptor is enough.
        Hide
        Trustin Lee added a comment - - edited

        My research was too shallow. It's not that extremely simple.

        1) It seems like a connected MulticastSocket doesn't make sense, so we will need only an IoAcceptor implementation for multicast socket, derived from DatagramAcceptor.
        2) join/leave Group() method should be in IoAcceptor instead of IoSession.
        3) We already have session.write(message, destination), so there's nothing to change related with sending a message.
        4) The parameter of IoAcceptor.joinGroup() and IoAcceptor.leaveGroup() should be abstracted as much as possible so it can work with various multicast frameworks needless to say ordinary multicast socket.

        Consequently, we need to,

        1) Define a SocketAddress that can abstract existing multicast group addresses.
        2) Add IoAcceptor.join/leave Group() which throws UnsupportedOperationException by default.

        Please let me know I am getting something wrong. Any feed back from multicast expert is welcome!

        Show
        Trustin Lee added a comment - - edited My research was too shallow. It's not that extremely simple. 1) It seems like a connected MulticastSocket doesn't make sense, so we will need only an IoAcceptor implementation for multicast socket, derived from DatagramAcceptor. 2) join/leave Group() method should be in IoAcceptor instead of IoSession. 3) We already have session.write(message, destination), so there's nothing to change related with sending a message. 4) The parameter of IoAcceptor.joinGroup() and IoAcceptor.leaveGroup() should be abstracted as much as possible so it can work with various multicast frameworks needless to say ordinary multicast socket. Consequently, we need to, 1) Define a SocketAddress that can abstract existing multicast group addresses. 2) Add IoAcceptor.join/leave Group() which throws UnsupportedOperationException by default. Please let me know I am getting something wrong. Any feed back from multicast expert is welcome!
        Hide
        Trustin Lee added a comment -

        I researched a little bit about MulticastSocket and thought we could do like the following:

        • Add IoSession.join/leaveGroup(SocketAddress) which throws UnsupportedOperationException for now.
        • All other properties (timeToLive, interface, networkInterface and loopbackMode) could be added later, because they won't affect the core API at all.

        WDYT? If there's no objection, let me add joinGroup and leaveGroup and reschedule this issue.

        Show
        Trustin Lee added a comment - I researched a little bit about MulticastSocket and thought we could do like the following: Add IoSession.join/leaveGroup(SocketAddress) which throws UnsupportedOperationException for now. All other properties (timeToLive, interface, networkInterface and loopbackMode) could be added later, because they won't affect the core API at all. WDYT? If there's no objection, let me add joinGroup and leaveGroup and reschedule this issue.
        Hide
        Trustin Lee added a comment - - edited

        For setting TTL, we could simply extend IoSessionConfig, or reuse writeTimeout property.

        Show
        Trustin Lee added a comment - - edited For setting TTL, we could simply extend IoSessionConfig, or reuse writeTimeout property.
        Hide
        Trustin Lee added a comment -

        We could map 'join' operation to session creation and 'leave' operation to session close. I don't have much experience with multicast, so please let me know what additional operations are required.

        What do you think about adding JGroups transport? Then we will get to know what is missing now.

        Show
        Trustin Lee added a comment - We could map 'join' operation to session creation and 'leave' operation to session close. I don't have much experience with multicast, so please let me know what additional operations are required. What do you think about adding JGroups transport? Then we will get to know what is missing now.
        Hide
        Julien Vermillard added a comment -

        Yes, but we need to modify IoSession API for add a generic multicast support

        Show
        Julien Vermillard added a comment - Yes, but we need to modify IoSession API for add a generic multicast support
        Hide
        Trustin Lee added a comment -

        Can we support multicast using APR transport implementation until Java 7 is released?

        Show
        Trustin Lee added a comment - Can we support multicast using APR transport implementation until Java 7 is released?
        Julien Vermillard created issue -

          People

          • Assignee:
            Julien Vermillard
            Reporter:
            Julien Vermillard
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:

              Development