This is an automated email from the ASF dual-hosted git repository. gilbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 7232dc139fe1e41db8d9476a16383df5ddbe427a Author: Qian Zhang <zhq527...@gmail.com> AuthorDate: Thu Aug 15 14:04:17 2019 -0700 Included task group's resources in the ExecutorInfo. Review: https://reviews.apache.org/r/71244/ --- src/slave/slave.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp index 74eb457..1d0ec9d 100644 --- a/src/slave/slave.cpp +++ b/src/slave/slave.cpp @@ -3110,15 +3110,21 @@ void Slave::__run( defaultExecutorCommandInfo(flags.launcher_dir, executor->user); } - // NOTE: We modify the ExecutorInfo to include the task's resources when - // launching the executor so that the containerizer has non-zero resources - // to work with when the executor has no resources. This should be revisited - // after MESOS-600. - if (task.isSome()) { - *executorInfo_.mutable_resources() = - Resources(executorInfo.resources()) + task->resources(); + // We modify the ExecutorInfo to include the task/task group's resources + // when launching the executor so that the containerizer has non-zero + // resources to work with when the executor has no resources. And this is + // also helpful for the executor to have enough resources to start because + // usually the resources that framework gives to executor are pretty small + // (e.g., Marathon/mesos-execute give 0.1 CPUs to the default executor) so + // the executor may be throttled by CFS, see MESOS-9925 for details. + Resources tasksResources; + foreach (const TaskInfo& _task, tasks) { + tasksResources += _task.resources(); } + *executorInfo_.mutable_resources() = + Resources(executorInfo.resources()) + tasksResources; + // Add the default container info to the executor info. // TODO(jieyu): Rename the flag to be default_mesos_container_info. if (!executorInfo_.has_container() &&