Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M6
    • Fix Version/s: 2.0.8
    • Component/s: Transport
    • Labels:
      None

      Description

      Current MINA implementation doesn't support half-duplex close as described in RFC-793 section 3.5. "Closing a Connection".

      After the read in AbstractPollingIoProcessor#read() fails due to closed of the input stream whole NioSocketSession#channel is scheduled to close. In such situation only the input part should be closed with call to SocketChannel#socket().shutdownInput(). The whole channel should be closed only after the IoSession#close() call.

        Activity

        Hide
        elecharny Emmanuel Lecharny added a comment -

        I'm afraid this will be a bit difficult to fix for 2.0.

        We have to think about it for 3.0, IMO.

        Show
        elecharny Emmanuel Lecharny added a comment - I'm afraid this will be a bit difficult to fix for 2.0. We have to think about it for 3.0, IMO.
        Hide
        jtau8042 Jan Tauš added a comment -

        I created patch of MINA(2.0.0.RC1) and AsyncWeb(trunk) (both attached) for my use.

        The problem is that it is application protocol dependent what to do when the input is closed. So my patch sends new event "inputClose(IoSession)" to the filter chain instead closing the session. The default handling of this event is to close the session.

        The patch of the AsyncWeb adds the handling of the new event to the SingleHttpSessionIoHandler. If there exists HTTP service context then the context is marked to close HTTP connection after a response is commited. If the context doesn't exists the session is closed immediately.

        Show
        jtau8042 Jan Tauš added a comment - I created patch of MINA(2.0.0.RC1) and AsyncWeb(trunk) (both attached) for my use. The problem is that it is application protocol dependent what to do when the input is closed. So my patch sends new event "inputClose(IoSession)" to the filter chain instead closing the session. The default handling of this event is to close the session. The patch of the AsyncWeb adds the handling of the new event to the SingleHttpSessionIoHandler. If there exists HTTP service context then the context is marked to close HTTP connection after a response is commited. If the context doesn't exists the session is closed immediately.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Patch applied
        Fixed with commit d3f53778d6d79a2611c4492364e3d9992e1b4312

        Show
        elecharny Emmanuel Lecharny added a comment - Patch applied Fixed with commit d3f53778d6d79a2611c4492364e3d9992e1b4312
        Hide
        reden Rob Eden added a comment -

        Cool, but annoying that this change happened in a maintenance release as it broke all my IoHandlers. Changing the version to 2.1 would have been nice.

        Show
        reden Rob Eden added a comment - Cool, but annoying that this change happened in a maintenance release as it broke all my IoHandlers. Changing the version to 2.1 would have been nice.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Rob, you are 100% right. This is my fault. Going for a 2.1.0 would have been the right move... Sorry for that.

        Show
        elecharny Emmanuel Lecharny added a comment - Rob, you are 100% right. This is my fault. Going for a 2.1.0 would have been the right move... Sorry for that.
        Hide
        reden Rob Eden added a comment -

        Emmanuel Lecharny - No worries, it happens. Thanks!

        Show
        reden Rob Eden added a comment - Emmanuel Lecharny - No worries, it happens. Thanks!

          People

          • Assignee:
            Unassigned
            Reporter:
            jtau8042 Jan Tauš
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development