Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-9707

Calling link::lo() may cause runtime error

    XMLWordPrintableJSON

    Details

      Description

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

        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;
          }
      }
      

      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

      else if (test.isSome()) {
              if (test.get()) {
                  return link;
              }
          }
      

      solves an issue.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                pKirillov Pavel
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m