From a976b6dc68cd2f8f2fe0881e077eaa83c78a9eda Mon Sep 17 00:00:00 2001 From: longfei Date: Sun, 19 May 2019 18:25:26 +0800 Subject: [PATCH] Return early in fetcher if no uris are specified. Change-Id: I9e78b0a9a58e6d84885eae768a5d76e13288c7af --- src/slave/containerizer/fetcher.cpp | 3 +++ src/slave/containerizer/mesos/isolators/filesystem/linux.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/slave/containerizer/fetcher.cpp b/src/slave/containerizer/fetcher.cpp index 8ae789a9f26..1f3b8499336 100644 --- a/src/slave/containerizer/fetcher.cpp +++ b/src/slave/containerizer/fetcher.cpp @@ -366,6 +366,9 @@ Future FetcherProcess::fetch( const string& sandboxDirectory, const Option& user) { + if (commandInfo.uris_size() == 0) { + return Nothing(); + } VLOG(1) << "Starting to fetch URIs for container: " << containerId << ", directory: " << sandboxDirectory; diff --git a/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp b/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp index 7b50258ef54..c7b12551862 100644 --- a/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp +++ b/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp @@ -596,7 +596,7 @@ Future LinuxFilesystemIsolatorProcess::recover( rootSandboxPath, entry.target); - // Since we pass the same 'entry.target' to 'parseSandboxPath' and + // Since we pass the same 'entry.target' to 'parseExecutorRunPath' and // 'parseSandboxPath', we should not see an error here. if (containerId.isError()) { return Failure("Parsing sandbox path failed: " + containerId.error());