You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Andrei Budnik (JIRA)" <ji...@apache.org> on 2019/04/08 17:15:00 UTC

[jira] [Commented] (MESOS-9707) Calling link::lo() may cause runtime error

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

Andrei Budnik commented on MESOS-9707:
--------------------------------------

Thanks for filing the ticket!
Would you like to create a PR for the fix on [https://github.com/apache/mesos]?
[http://mesos.apache.org/documentation/latest/beginner-contribution/#open-a-pr]

> 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
>
> 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)