You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ya...@apache.org on 2016/10/20 00:36:16 UTC
mesos git commit: Fixed a bug that causes the fetcher to not chown
the sandbox.
Repository: mesos
Updated Branches:
refs/heads/master bf00061b5 -> e65b40d48
Fixed a bug that causes the fetcher to not chown the sandbox.
Moved the `uri.size() == 0` check in fetcher so that the chown to
task user of stdout/stderr in sandbox directory happens even when
there is no uri to be fetched.
Review: https://reviews.apache.org/r/52828/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e65b40d4
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e65b40d4
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e65b40d4
Branch: refs/heads/master
Commit: e65b40d48b25ecf45805c8a740a412074da00d1f
Parents: bf00061
Author: Megha Sharma <ms...@apple.com>
Authored: Wed Oct 19 17:34:19 2016 -0700
Committer: Jiang Yan Xu <xu...@apple.com>
Committed: Wed Oct 19 17:34:19 2016 -0700
----------------------------------------------------------------------
src/slave/containerizer/fetcher.cpp | 9 +++++----
src/tests/slave_tests.cpp | 4 ++--
2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/e65b40d4/src/slave/containerizer/fetcher.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/fetcher.cpp b/src/slave/containerizer/fetcher.cpp
index 11104d6..1a7f474 100644
--- a/src/slave/containerizer/fetcher.cpp
+++ b/src/slave/containerizer/fetcher.cpp
@@ -254,10 +254,6 @@ Future<Nothing> Fetcher::fetch(
const SlaveID& slaveId,
const Flags& flags)
{
- if (commandInfo.uris().size() == 0) {
- return Nothing();
- }
-
return dispatch(process.get(),
&FetcherProcess::fetch,
containerId,
@@ -784,6 +780,11 @@ Future<Nothing> FetcherProcess::run(
}
#endif // __WINDOWS__
+ // Return early if there are no URIs to fetch.
+ if (info.items_size() == 0) {
+ return Nothing();
+ }
+
string fetcherPath = path::join(flags.launcher_dir, "mesos-fetcher");
Result<string> realpath = os::realpath(fetcherPath);
http://git-wip-us.apache.org/repos/asf/mesos/blob/e65b40d4/src/tests/slave_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index ab46293..e7e3e33 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -866,7 +866,7 @@ TEST_F(SlaveTest, GetExecutorInfoForTaskWithContainer)
// MesosContainerizer would fail the launch.
//
// TODO(jieyu): Move this test to the mesos containerizer tests.
-TEST_F(SlaveTest, LaunchTaskInfoWithContainerInfo)
+TEST_F(SlaveTest, ROOT_LaunchTaskInfoWithContainerInfo)
{
Try<Owned<cluster::Master>> master = StartMaster();
ASSERT_SOME(master);
@@ -929,7 +929,7 @@ TEST_F(SlaveTest, LaunchTaskInfoWithContainerInfo)
task,
executor,
sandbox.get(),
- "test",
+ "nobody",
slaveID,
map<string, string>(),
false);