Repository: mesos Updated Branches: refs/heads/master ea6a799fe -> 201eb88be
Fixed the port mapping isolator to not fail on speed read failure. Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/201eb88b Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/201eb88b Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/201eb88b Branch: refs/heads/master Commit: 201eb88be8dd64fad3bca7b43f0dfe146a851324 Parents: ea6a799 Author: Jie Yu <[email protected]> Authored: Mon Feb 20 10:05:59 2017 -0800 Committer: Jie Yu <[email protected]> Committed: Mon Feb 20 10:05:59 2017 -0800 ---------------------------------------------------------------------- .../containerizer/mesos/isolators/network/port_mapping.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/201eb88b/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp b/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp index c689aab..4ecc4aa 100644 --- a/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp +++ b/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp @@ -1599,9 +1599,12 @@ Try<Isolator*> PortMappingIsolatorProcess::create(const Flags& flags) } else { Try<string> value = os::read(eth0SpeedPath); if (value.isError()) { - return Error( - "Failed to read '" + eth0SpeedPath + "'" - ": " + value.error()); + // NOTE: Even if the speed file exists, the read might fail if + // the driver does not support reading the speed. Therefore, + // we print a warning here, instead of failing. + LOG(WARNING) << "Cannot determine link speed of " << eth0.get() + << ": Failed to read '" << eth0SpeedPath + << "': " << value.error(); } else { Try<uint64_t> hostLinkSpeed = numify<uint64_t>(strings::trim(value.get()));
