Pavel created MESOS-9707:
----------------------------

             Summary: Calling link::lo() may cause runtime error 
                 Key: MESOS-9707
                 URL: https://issues.apache.org/jira/browse/MESOS-9707
             Project: Mesos
          Issue Type: Bug
    Affects Versions: 1.7.2
            Reporter: Pavel


If mesos uses isolation="network/port_mapping" it calls link::lo() during 
PortMappingIsolatorProcess::create procedure:

{code:C++}
  Try<set<string>> links = net::links();
  if (links.isError()) {
    return Error("Failed to get all the links: " + links.error());
  }
  foreach (const string& link, links.get()) {
    Result<bool> test = link::internal::test(link, IFF_LOOPBACK);
    if (test.isError()) {
      return Error("Failed to check the flag on link: " + link);
    } else if (test.get()) {
      return link;
    }
}
{code}

it iterates through net::links() and return first one with IFF_LOOPBACK flag.
For some network configurations test var cound be None and test.get() throws 
runtime error.
In my case bridged interface caused link::internal::test(link, IFF_LOOPBACK) to 
be None.

Changing code to 
{code:C++}
else if (test.isSome()) {
        if (test.get()) {
            return link;
        }
    }
{code}
solves an issue.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to