Uploaded image for project: 'REEF'
  1. REEF
  2. REEF-1808

Fix lack of tcp port error in NettyMessagingTransport

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • Wake
    • None
    • Java

    Description

      The constructor of NettyMessagingTransport occasionally spits some exception saying there is no available TCP port, depending on the network environment.

      This error occurs when TcpPortProvider fails to find available TCP port in the local address provided by LocalAddressProvider.

      This error does not occur when I changed LegacyLocalAddressProvider (of version 0.15.0) as the default implementation of LocalAddressProvider, but it was deprecated already.
      It seems that the local address given by HostnameBasedLocalAddressProvider does not have available TCP port sometimes.
      Because of this, we need to fix it or develop another LocalAddressProvider that can provide local address with available TCP ports.

      Full message was like below.

      Caused by: java.lang.RuntimeException: org.apache.reef.tang.exceptions.InjectionException: Could not invoke constructor: new NettyMessagingTransport(String HostAddress = ##UNKNOWN##, Integer Port = 0, EStage RemoteClientStage = org.apache.reef.wake.remote.impl.OrderedRemoteReceiverStage@47523643, EStage RemoteServerStage = org.apache.reef.wake.remote.impl.OrderedRemoteReceiverStage@47523643, Integer NumberOfTries = 3, Integer RetryTimeout = 10000, [ClassNodeImpl 'org.apache.reef.wake.remote.ports.TcpPortProvider']: = RangeTcpPortProvider

      Unknown macro: {portRangeBegin=10000, portRangeCount=10000, portRangeTryCount=1000}

      , LocalAddressProvider = new HostnameBasedLocalAddressProvider())
      at org.apache.reef.wake.remote.transport.netty.MessagingTransportFactory.newInstance(MessagingTransportFactory.java:135)
      at org.apache.reef.wake.remote.impl.DefaultRemoteManagerImplementation.<init>(DefaultRemoteManagerImplementation.java:89)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.apache.reef.tang.implementation.java.InjectorImpl.injectFromPlan(InjectorImpl.java:637)
      ... 50 more
      Caused by: org.apache.reef.tang.exceptions.InjectionException: Could not invoke constructor: new NettyMessagingTransport(String HostAddress = ##UNKNOWN##, Integer Port = 0, EStage RemoteClientStage = org.apache.reef.wake.remote.impl.OrderedRemoteReceiverStage@47523643, EStage RemoteServerStage = org.apache.reef.wake.remote.impl.OrderedRemoteReceiverStage@47523643, Integer NumberOfTries = 3, Integer RetryTimeout = 10000, [ClassNodeImpl 'org.apache.reef.wake.remote.ports.TcpPortProvider']: = RangeTcpPortProvider

      , LocalAddressProvider = new HostnameBasedLocalAddressProvider())
      at org.apache.reef.tang.implementation.java.InjectorImpl.injectFromPlan(InjectorImpl.java:654)
      at org.apache.reef.tang.implementation.java.InjectorImpl.getInstance(InjectorImpl.java:515)
      at org.apache.reef.tang.implementation.java.InjectorImpl.getInstance(InjectorImpl.java:533)
      at org.apache.reef.wake.remote.transport.netty.MessagingTransportFactory.newInstance(MessagingTransportFactory.java:133)
      ... 56 more
      Caused by: org.apache.reef.wake.remote.transport.exception.TransportRuntimeException: tcpPortProvider failed to return free ports.
      at org.apache.reef.wake.remote.transport.netty.NettyMessagingTransport.<init>(NettyMessagingTransport.java:183)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.apache.reef.tang.implementation.java.InjectorImpl.injectFromPlan(InjectorImpl.java:637)
      ... 59 more
      Caused by: java.lang.IllegalStateException: tcpPortProvider cannot find a free port.
      at org.apache.reef.wake.remote.transport.netty.NettyMessagingTransport.<init>(NettyMessagingTransport.java:167)
      ... 64 more

      Attachments

        Activity

          People

            Unassigned Unassigned
            sanha Sanha Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: