Uploaded image for project: 'Marathon'
  1. Marathon
  2. MARATHON-4045

Process doesn't exit if port is already in use

    Details

    • Type: Task
    • Status: Resolved
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None

      Description

      If two Marathon instances are started on the same machine on the same port, the second one throws an exception but never exits. It seems more appropriate to print an error and exit. Is there a reason to let the second process live?

      Stack trace from second Marathon process:

      INFO: Binding mesosphere.marathon.api.v1.TasksResource to GuiceManagedComponentProvider with the scope "Singleton"
      Jan 14, 2014 10:51:48 AM org.eclipse.jetty.util.component.AbstractLifeCycle setFailed
      WARNING: FAILED SelectChannelConnector@0.0.0.0:8080: java.net.BindException: Address already in use
      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.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
          at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
          at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
          at org.eclipse.jetty.server.Server.doStart(Server.java:293)
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
          at mesosphere.chaos.http.HttpService.startUp(HttpService.scala:17)
          at com.google.common.util.concurrent.AbstractIdleService$1$1.run(AbstractIdleService.java:43)
          at java.lang.Thread.run(Thread.java:724)
      
      Jan 14, 2014 10:51:48 AM org.eclipse.jetty.util.component.AbstractLifeCycle setFailed
      WARNING: FAILED org.eclipse.jetty.server.Server@313428df: java.net.BindException: Address already in use
      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.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
          at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
          at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
          at org.eclipse.jetty.server.Server.doStart(Server.java:293)
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
          at mesosphere.chaos.http.HttpService.startUp(HttpService.scala:17)
          at com.google.common.util.concurrent.AbstractIdleService$1$1.run(AbstractIdleService.java:43)
          at java.lang.Thread.run(Thread.java:724)
      
      Exception in thread "HttpService STARTING" java.lang.RuntimeException: java.net.BindException: Address already in use
          at com.google.common.base.Throwables.propagate(Throwables.java:160)
          at com.google.common.util.concurrent.AbstractIdleService$1$1.run(AbstractIdleService.java:47)
          at java.lang.Thread.run(Thread.java:724)
      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.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
          at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
          at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
          at org.eclipse.jetty.server.Server.doStart(Server.java:293)
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
          at mesosphere.chaos.http.HttpService.startUp(HttpService.scala:17)
          at com.google.common.util.concurrent.AbstractIdleService$1$1.run(AbstractIdleService.java:43)
          ... 1 more
      

        Attachments

          Activity

            People

            • Assignee:
              matthias Matthias Veit (Inactive)
              Reporter:
              GitHub_ssorallen Ross Allen (Inactive)
              Team:
              Orchestration Team
              Watchers:
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: