You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by haoyixin <gi...@git.apache.org> on 2017/06/20 06:12:19 UTC

[GitHub] mesos pull request #220: Fix a bug of logging in cni isolator.

GitHub user haoyixin opened a pull request:

    https://github.com/apache/mesos/pull/220

    Fix a bug of logging in cni isolator.

    the old errno would always be 0, and we can't get the reason that why execute ifconfig failed.
    
    so, we use the return value of spawn for WSTRINGIFYing error in log.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/haoyixin/mesos haoyixin

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/mesos/pull/220.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #220
    
----
commit be79049a7ffc11fd2914a0a2ef33343a05b9004f
Author: haoyixin <ha...@haoyixintekimacbook-air.local>
Date:   2017-06-20T06:07:38Z

    Fix a bug of logging in cni isolator.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] mesos pull request #220: Fix a bug of logging in cni isolator.

Posted by haosdent <gi...@git.apache.org>.
Github user haosdent commented on a diff in the pull request:

    https://github.com/apache/mesos/pull/220#discussion_r122888338
  
    --- Diff: src/slave/containerizer/mesos/isolators/network/cni/cni.cpp ---
    @@ -1994,11 +1995,13 @@ int NetworkCniIsolatorSetup::execute()
           return EXIT_FAILURE;
         }
     
    -    if (os::spawn("ifconfig", {"ifconfig", "lo", "up"}) != 0) {
    -      cerr << "Failed to bring up the loopback interface in the new "
    -           << "network namespace of pid " << flags.pid.get()
    -           << ": " << os::strerror(errno) << endl;
    -      return EXIT_FAILURE;
    +    int spawn = os::spawn("ifconfig", {"ifconfig", "lo", "up"});
    +
    +    if (spawn != 0) {
    +        cerr << "Failed to bring up the loopback interface in the new "
    +            << "network namespace of pid " << flags.pid.get()
    --- End diff --
    
    Add a extra space, need to align "<<"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] mesos issue #220: Fix a bug of logging in cni isolator.

Posted by haosdent <gi...@git.apache.org>.
Github user haosdent commented on the issue:

    https://github.com/apache/mesos/pull/220
  
    Can use `Fixed a bug in the logging of cni isolator.`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] mesos pull request #220: Fix a bug of logging in cni isolator.

Posted by haosdent <gi...@git.apache.org>.
Github user haosdent commented on a diff in the pull request:

    https://github.com/apache/mesos/pull/220#discussion_r122889806
  
    --- Diff: src/slave/containerizer/mesos/isolators/network/cni/cni.cpp ---
    @@ -1994,11 +1995,13 @@ int NetworkCniIsolatorSetup::execute()
           return EXIT_FAILURE;
         }
     
    -    if (os::spawn("ifconfig", {"ifconfig", "lo", "up"}) != 0) {
    -      cerr << "Failed to bring up the loopback interface in the new "
    -           << "network namespace of pid " << flags.pid.get()
    -           << ": " << os::strerror(errno) << endl;
    -      return EXIT_FAILURE;
    +    int spawn = os::spawn("ifconfig", {"ifconfig", "lo", "up"});
    +
    +    if (spawn != 0) {
    +        cerr << "Failed to bring up the loopback interface in the new "
    +            << "network namespace of pid " << flags.pid.get()
    +            << ": " << (spawn < 0 ? "failed to fork process" : WSTRINGIFY(spawn)) << endl;
    +        return EXIT_FAILURE;
         }
       }
    --- End diff --
    
    `Failed to fork process`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] mesos pull request #220: Fix a bug of logging in cni isolator.

Posted by haosdent <gi...@git.apache.org>.
Github user haosdent commented on a diff in the pull request:

    https://github.com/apache/mesos/pull/220#discussion_r122888509
  
    --- Diff: src/slave/containerizer/mesos/isolators/network/cni/cni.cpp ---
    @@ -31,6 +31,7 @@
     #include <stout/strings.hpp>
     
     #include <stout/os/constants.hpp>
    +#include "common/status_utils.hpp"
    --- End diff --
    
    Put it after `#include "common/protobuf_utils.hpp"`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] mesos issue #220: Fix a bug of logging in cni isolator.

Posted by haoyixin <gi...@git.apache.org>.
Github user haoyixin commented on the issue:

    https://github.com/apache/mesos/pull/220
  
    i will close the pr and make a new one.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] mesos pull request #220: Fix a bug of logging in cni isolator.

Posted by haoyixin <gi...@git.apache.org>.
Github user haoyixin closed the pull request at:

    https://github.com/apache/mesos/pull/220


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---