[ 
https://issues.apache.org/jira/browse/MESOS-9707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16813109#comment-16813109
 ] 

Pavel commented on MESOS-9707:
------------------------------

[~abudnik] here it is: 
https://github.com/apache/mesos/pull/330

> 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
>            Priority: Major
>              Labels: containerization, network, newbie++
>
> 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