Uploaded image for project: 'Netty'
  1. Netty
  2. NETTY-407

HttpTunnelingClientSocketChannel failed close() is not sent to calling futures.

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.2.5.Final
    • Component/s: None
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Create a HornetQ with netty-servlet transport. Stop the server and start the client. The client will first get a Connection refused exception and then hang when trying to close the connection which was not yet opened.

      Show
      Create a HornetQ with netty-servlet transport. Stop the server and start the client. The client will first get a Connection refused exception and then hang when trying to close the connection which was not yet opened.

      Description

      Quoting from http://www.jboss.org/netty/community.html#nabble-td5729020

      When using Netty (3.2.3-Final) with the HornetQ (2.1.2) servlet transport, a failure to connect to the HornetQ server (e.g. when specifying an incorrect port) can cause HornetQ to hang on this line in the NettyConnector close() method:

      channelGroup.close().awaitUninterruptibly();

      It looks like the problem may be that HttpTunnelingClientSocketChannel writeLastChunk() (called by closeReal()), throws a NotYetConnectedException (because the connect failed and the request header did not get written).

      The failure of the close neither gets back to the future returned by close, nor does close() throw an exception, so it hangs.

      I could reproduce this with Netty 3.2.4-Final and HornetQ 2.2.2-Final.
      The writeLastChunk() should return e.g. a failedFuture to notify its callers.

      E.g:
      if (!requestHeaderWritten)
      return Channels.failedFuture( this, new NotYetConnectedException() );

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                trustin Trustin Lee
                Reporter:
                greyfairer2 Geert Pante
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: