You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2018/11/07 21:47:53 UTC
[mesos] branch master updated: Clarified some comments about the
usage of offer filters.
This is an automated email from the ASF dual-hosted git repository.
josephwu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new 8264de1 Clarified some comments about the usage of offer filters.
8264de1 is described below
commit 8264de113e892d9376a0f90392bd856e30ca4803
Author: Benno Evers <be...@mesosphere.com>
AuthorDate: Wed Nov 7 13:31:53 2018 -0800
Clarified some comments about the usage of offer filters.
Improved formatting in the scheduler API description, and updated
comments to explicitly mention the default value for the
`refuse_offers` field.
Review: https://reviews.apache.org/r/69272/
---
include/mesos/scheduler.hpp | 17 ++++++++++-------
src/master/master.cpp | 3 ++-
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/include/mesos/scheduler.hpp b/include/mesos/scheduler.hpp
index 7e029f1..2ea7cdf 100644
--- a/include/mesos/scheduler.hpp
+++ b/include/mesos/scheduler.hpp
@@ -231,13 +231,16 @@ public:
// those that are not used by the launched tasks or their executors)
// will be considered declined. Note that this includes resources
// used by tasks that the framework attempted to launch but failed
- // (with TASK_ERROR) due to a malformed task description. The
- // specified filters are applied on all unused resources (see
- // mesos.proto for a description of Filters). Available resources
- // are aggregated when multiple offers are provided. Note that all
- // offers must belong to the same slave. Invoking this function with
- // an empty collection of tasks declines offers in their entirety
- // (see Scheduler::declineOffer).
+ // (with TASK_ERROR) due to a malformed task description.
+ //
+ // The specified filters are applied on all unused resources (see
+ // mesos.proto for a description of Filters). Note that the default
+ // argument includes a 5-second `refuse_offers` filter.
+ //
+ // Available resources are aggregated when multiple offers are provided.
+ // Note that all offers must belong to the same slave. Invoking this
+ // function with an empty collection of tasks declines offers in their
+ // entirety (see Scheduler::declineOffer).
virtual Status launchTasks(
const std::vector<OfferID>& offerIds,
const std::vector<TaskInfo>& tasks,
diff --git a/src/master/master.cpp b/src/master/master.cpp
index f88c7c1..1e326ec 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -9370,7 +9370,8 @@ void Master::offer(
<< "executors";
// Pass a default filter to avoid getting this same offer immediately
- // from the allocator.
+ // from the allocator. Note that a default-constructed `Filters`
+ // object has its `refuse_seconds` offer filter set to 5 seconds.
allocator->recoverResources(frameworkId, slaveId, offered, Filters());
continue;
}