Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-1085

Setting suspendRead on IoSession prevents new connections in shared NioDatagramAcceptor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.17
    • 2.0.18
    • Core
    • None
    • Red5 Pro Server on Ubuntu

    Description

      When using the ice4j library with integrated Mina 2.0.17, we have run into an issue that is caused by our defensive action against browsers. The idea was to suspendRead on the target IoSession when it was in the process of being closed / cleaned up, but in doing so, the server can get in a bad state where it no longer accepts connections. As seen in the log snipit below, suspendRead on the IoSession causes a UOEx in the shared NioDatagramAcceptor; "shared" being the operative word here. It would seem to us that acceptors may be shared with impunity, if this is not the case, we can update ice4j to prevent sharing. I'll add some test code if required, but for now, this is what I have and here is the github location of our ice4j fork https://github.com/Red5/ice4j

       

      2018-05-23 14:31:00,433 [NioDatagramAcceptor-8] WARN org.ice4j.ice.nio.IceHandler - Exception on 10.198.219.143:60515/udp
      org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.UnsupportedOperationException (Hexdump: 00 01 00 54 21 12 A4 42 4D 57 6B 68 38 71 54 65 2F 51 70 51 00 06 00 13 61 6E 6E 64 6E 31 63 65 36 6D 68 74 66 35 3A 77 47 6E 5A 00 C0 57 00 04 00 00 00 32 80 29 00 08 09 6C 92 9E 9D BC 63 05 00 24 00 04 6E 00 1F 00 00 08 00 14 98 EC A7 54 01 47 86 DE FF 18 52 B5 59 74 A6 51 D9 C9 A1 C6 80 28 00 04 13 6F 2C F0)
      {{ at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:262)}}
      {{ at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:641)}}
      {{ at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:48)}}
      {{ at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1114)}}
      {{ at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:121)}}
      {{ at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:641)}}
      {{ at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:634)}}
      {{ at org.apache.mina.transport.socket.nio.NioDatagramAcceptor.readHandle(NioDatagramAcceptor.java:306)}}
      {{ at org.apache.mina.transport.socket.nio.NioDatagramAcceptor.processReadySessions(NioDatagramAcceptor.java:270)}}
      {{ at org.apache.mina.transport.socket.nio.NioDatagramAcceptor.access$700(NioDatagramAcceptor.java:68)}}
      {{ at org.apache.mina.transport.socket.nio.NioDatagramAcceptor$Acceptor.run(NioDatagramAcceptor.java:181)}}
      {{ at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)}}
      {{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
      {{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
      {{ at java.lang.Thread.run(Thread.java:748)}}
      Caused by: java.lang.UnsupportedOperationException: null
      {{ at org.apache.mina.transport.socket.nio.NioDatagramAcceptor.updateTrafficControl(NioDatagramAcceptor.java:823)}}
      {{ at org.apache.mina.transport.socket.nio.NioDatagramAcceptor.updateTrafficControl(NioDatagramAcceptor.java:68)}}
      {{ at org.apache.mina.core.session.AbstractIoSession.suspendRead(AbstractIoSession.java:718)}}
      {{ at org.ice4j.ice.nio.IceDecoder.decode(IceDecoder.java:220)}}
      {{ at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:253)}}
      {{ ... 14 common frames omitted}}

      Attachments

        Activity

          People

            Unassigned Unassigned
            mondain Paul Gregoire
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: