[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=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> links = net::links(); > if (links.isError()) { > return Error("Failed to get all the links: " + links.error()); > } > foreach (const string& link, links.get()) { > Result 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)
[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=16812768#comment-16812768 ] Pavel commented on MESOS-9707: -- Yes, i'd love to, let me take some time to understand the PR procedure and i'll prepare one. > 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> links = net::links(); > if (links.isError()) { > return Error("Failed to get all the links: " + links.error()); > } > foreach (const string& link, links.get()) { > Result 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)
[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> links = net::links(); > if (links.isError()) { > return Error("Failed to get all the links: " + links.error()); > } > foreach (const string& link, links.get()) { > Result 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)