[ 
https://issues.apache.org/jira/browse/MESOS-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155628#comment-13155628
 ] 

Andy Konwinski commented on MESOS-35:
-------------------------------------

I believe this issue no longer manifests (as of SVN r1205259) if you don't 
specify a value for work_dir when running the mesos slave (i.e. if you let the 
default values be used for them, which is either mesos_home or ".").

Michael and I use deploylib (deploylib.com), in which we run mesos on EC2 and 
we set it up to use a config file in which we specify that work_dir = /mnt and 
this causes the links (in the slave webui) for a framework's executors' stderr 
and stdout to break. The erro message says that the /mnt/slave/... directory 
can't be found. When I manually look, the file that is looking for is in 
/mnt/work/slave/... (notice the extra "/work").

It appears that with these config settings, slave.cpp puts files in a different 
directory (relative to work_dir from conf) than webui/slave/webui.py looks for 
them in.

In src/slave/slave.cpp, when we're building up the directory where the 
executors' stderr and stdout will eventually go, if work_dir is present as a 
conf value, we should not append "/work" to it, but we currently do. See 
snippet below, starting at line 1381:

<code>
1381   string workDir = ".";
1382   if (conf.contains("work_dir")) {
1383     workDir = conf.get("work_dir", workDir);
1384   } else if (conf.contains("home")) {
1385     workDir = conf.get("home", workDir);
1386   }
1387 
1388   workDir = workDir + "/work";
1389 
1390   std::ostringstream out(std::ios_base::app | std::ios_base::out);
1391   out << workDir << "/slaves/" << id
1392       << "/frameworks/" << frameworkId
1393       << "/executors/" << executorId;

</code>

... having that extra "/work" in the path is breaking things, since when 
work_dir is set, src/slave/webui.cpp doesn't append "/work" to it (see starting 
at line 80):

<code>
 80   webuiPort = conf.get("webui_port", "8081");
 81   logDir = conf.get("log_dir", FLAGS_log_dir);
 82   if (conf.contains("work_dir")) {
 83     workDir = conf.get("work_dir", "");
 84   } else if (conf.contains("home")) {
 85     workDir = conf.get("home", "") + "/work";
 86   } else {
 87     workDir = "work";
 88   }
</code>

I'll attach a small patch that doesn't append "/work" to workDir in slave.cpp 
if workDir is set from the "work_dir" conf flag.
                
> Slave webui needs to correctly display stdout/stderr of executors.
> ------------------------------------------------------------------
>
>                 Key: MESOS-35
>                 URL: https://issues.apache.org/jira/browse/MESOS-35
>             Project: Mesos
>          Issue Type: Bug
>          Components: slave, webui
>            Reporter: Benjamin Hindman
>
> There have been some changes to the work directories for frameworks due to 
> multi-executor support and so the slave webui is no longer properly linking 
> to executors stdout/stderr.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to