You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Till Toenshoff (JIRA)" <ji...@apache.org> on 2016/12/07 21:07:58 UTC

[jira] [Created] (MESOS-6751) Mesos should allow for selective environment inheritance.

Till Toenshoff created MESOS-6751:
-------------------------------------

             Summary: Mesos should allow for selective environment inheritance.
                 Key: MESOS-6751
                 URL: https://issues.apache.org/jira/browse/MESOS-6751
             Project: Mesos
          Issue Type: Improvement
            Reporter: Till Toenshoff


We have often run into issues with environment variables inherited by subprocesses which in certain setups cause problems.
VERY recent examples are: 
- MESOS-6747
- MESOS-6748

The pattern for solving an inheritance that covers bases like PATH,  LD_LIBRARY_PATH and DYLD_LIBRARY_PATH but at the same time carves out traps like LIBPROCESS_-related variables and maybe also MESOS_-related variables is relatively simple. 

{noformat}
  map<string, string> environment;
  foreachpair (const string& key, const string& value, os::environment()) {
    if (!strings::startsWith(key, "LIBPROCESS_") &&
        !strings::startsWith(key, "MESOS_")) {
      environment.emplace(key, value);
    }
  }
{noformat}

But maybe we can somehow force the use of such pattern to make this kind of bug less frequent on new code that forks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)