Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-6643

TestRMFailover fails rarely due to port conflict

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.9.0, 3.0.0-alpha4
    • 2.9.0, 3.0.0-alpha4, 2.8.2
    • test
    • None

    Description

      We've seen various tests in TestRMFailover fail very rarely with a message like "org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.io.IOException: ResourceManager failed to start. Final state is STOPPED".

      After some digging, it turns out that it's due to a port conflict with the embedded ZooKeeper in the tests. The embedded ZooKeeper uses ServerSocketUtil#getPort to choose a free port, but the RMs are configured to 10000 + <default-port> and 20000 + <default-port> (e.g. the default port for the RM is 8032, so you'd use 18032 and 28032).

      When I was able to reproduce this, I saw that ZooKeeper was using port 18033, which is 10000 + 8033, the default RM Admin port. It results in an error like this, causing the RM to be unable to start, and hence the original error message in the test failure:

      2017-05-24 01:16:52,735 INFO  service.AbstractService (AbstractService.java:noteFailure(272)) - Service ResourceManager failed in state STARTED; cause: org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.net.BindException: Problem binding to [0.0.0.0:18033] java.net.BindException: Address already in use; For more details see:  http://wiki.apache.org/hadoop/BindException
      org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.net.BindException: Problem binding to [0.0.0.0:18033] java.net.BindException: Address already in use; For more details see:  http://wiki.apache.org/hadoop/BindException
              at org.apache.hadoop.yarn.factories.impl.pb.RpcServerFactoryPBImpl.getServer(RpcServerFactoryPBImpl.java:139)
              at org.apache.hadoop.yarn.ipc.HadoopYarnProtoRPC.getServer(HadoopYarnProtoRPC.java:65)
              at org.apache.hadoop.yarn.ipc.YarnRPC.getServer(YarnRPC.java:54)
              at org.apache.hadoop.yarn.server.resourcemanager.AdminService.startServer(AdminService.java:171)
              at org.apache.hadoop.yarn.server.resourcemanager.AdminService.serviceStart(AdminService.java:158)
              at org.apache.hadoop.service.AbstractService.start(AbstractService.java:193)
              at org.apache.hadoop.service.CompositeService.serviceStart(CompositeService.java:120)
              at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceStart(ResourceManager.java:1147)
              at org.apache.hadoop.service.AbstractService.start(AbstractService.java:193)
              at org.apache.hadoop.yarn.server.MiniYARNCluster$2.run(MiniYARNCluster.java:310)
      Caused by: java.net.BindException: Problem binding to [0.0.0.0:18033] java.net.BindException: Address already in use; For more details see:  http://wiki.apache.org/hadoop/BindException
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
              at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:791)
              at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:720)
              at org.apache.hadoop.ipc.Server.bind(Server.java:482)
              at org.apache.hadoop.ipc.Server$Listener.<init>(Server.java:688)
              at org.apache.hadoop.ipc.Server.<init>(Server.java:2376)
              at org.apache.hadoop.ipc.RPC$Server.<init>(RPC.java:1042)
              at org.apache.hadoop.ipc.ProtobufRpcEngine$Server.<init>(ProtobufRpcEngine.java:535)
              at org.apache.hadoop.ipc.ProtobufRpcEngine.getServer(ProtobufRpcEngine.java:510)
              at org.apache.hadoop.ipc.RPC$Builder.build(RPC.java:887)
              at org.apache.hadoop.yarn.factories.impl.pb.RpcServerFactoryPBImpl.createServer(RpcServerFactoryPBImpl.java:169)
              at org.apache.hadoop.yarn.factories.impl.pb.RpcServerFactoryPBImpl.getServer(RpcServerFactoryPBImpl.java:132)
              ... 9 more
      Caused by: java.net.BindException: Address already in use
              at sun.nio.ch.Net.bind0(Native Method)
              at sun.nio.ch.Net.bind(Net.java:444)
              at sun.nio.ch.Net.bind(Net.java:436)
              at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
              at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
              at org.apache.hadoop.ipc.Server.bind(Server.java:465)
              ... 17 more
      2017-05-24 01:16:52,736 DEBUG service.AbstractService (AbstractService.java:enterState(452)) - Service: ResourceManager entered state STOPPED
      

      Attachments

        1. YARN-6643.001.patch
          2 kB
          Robert Kanter

        Issue Links

          Activity

            People

              rkanter Robert Kanter
              rkanter Robert Kanter
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: