You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ch...@apache.org on 2018/12/20 23:51:31 UTC

[mesos] branch 1.5.x updated (6fd9106 -> 0de1fed)

This is an automated email from the ASF dual-hosted git repository.

chhsiao pushed a change to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from 6fd9106  Added MESOS-9411 to 1.5.3 CHANGELOG.
     new bf424eb  Removed unused variable in `master_validation_tests.cpp`.
     new 0bb23ba  Made master process all authorization results for `LAUNCH_GROUP`.
     new 8b39441  Added MESOS-9480 to the 1.5.2 CHANGELOG.
     new 0de1fed  Disabled warnings-as-errors for gRPC build.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 3rdparty/Makefile.am                  | 13 ++----
 CHANGELOG                             |  1 +
 src/master/master.cpp                 | 77 +++++++++++++++++++----------------
 src/tests/master_validation_tests.cpp |  2 -
 4 files changed, 48 insertions(+), 45 deletions(-)


[mesos] 01/04: Removed unused variable in `master_validation_tests.cpp`.

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chhsiao pushed a commit to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit bf424ebfe117afd9ee47e488928a6e7a17f9dc85
Author: Michael Park <mp...@apache.org>
AuthorDate: Sun Jan 28 14:17:51 2018 -0800

    Removed unused variable in `master_validation_tests.cpp`.
---
 src/tests/master_validation_tests.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/tests/master_validation_tests.cpp b/src/tests/master_validation_tests.cpp
index ed8f9bd..8e4f3e9 100644
--- a/src/tests/master_validation_tests.cpp
+++ b/src/tests/master_validation_tests.cpp
@@ -1065,8 +1065,6 @@ TEST_F(CreateOperationValidationTest, SharedVolumeBasedOnCapability)
 // than the offered disk resource results won't succeed.
 TEST_F(CreateOperationValidationTest, InsufficientDiskResource)
 {
-  protobuf::slave::Capabilities capabilities;
-
   FrameworkInfo frameworkInfo = DEFAULT_FRAMEWORK_INFO;
   frameworkInfo.set_roles(0, "role1");
 


[mesos] 04/04: Disabled warnings-as-errors for gRPC build.

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chhsiao pushed a commit to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 0de1fed16d01d30d01b057f5a50f616bf5553506
Author: Benno Evers <be...@mesosphere.com>
AuthorDate: Wed Oct 17 22:46:54 2018 +0200

    Disabled warnings-as-errors for gRPC build.
---
 3rdparty/Makefile.am | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/3rdparty/Makefile.am b/3rdparty/Makefile.am
index f4cb731..2b68134 100644
--- a/3rdparty/Makefile.am
+++ b/3rdparty/Makefile.am
@@ -313,24 +313,19 @@ LIB_GRPC = $(GRPC)/libs/opt/libgrpc++.a			\
 
 $(LIB_GRPC): $(GRPC)-build-stamp
 
-# NOTE: The `-Wno-deprecated-declarations` flag is added so that gRPC
-# can be built with OpenSSL 1.1.0. See:
-# https://github.com/grpc/grpc/pull/11496
-# NOTE: The `-Wno-unused-function` flag is added to address errors when
-# compling `src/core/tsi/ssl_transport_security.cc`. See:
-# https://github.com/grpc/grpc/pull/11675
+# We use EXTRA_CPPFLAGS to pass `-Wno-error`, because that one needs to be
+# appended and not prepended to the constructed flags.
 $(GRPC)-build-stamp: $(GRPC)-stamp			\
                      $(PROTOBUF)-build-stamp
 	cd $(GRPC) &&					\
-	  CPPFLAGS="-Wno-deprecated-declarations	\
-	            -Wno-unused-function		\
-	            $(PROTOBUF_INCLUDE_FLAGS)		\
+	  CPPFLAGS="$(PROTOBUF_INCLUDE_FLAGS)		\
 	            $(SSL_INCLUDE_FLAGS)		\
 	            $(ZLIB_INCLUDE_FLAGS)"		\
 	  LDFLAGS="$(PROTOBUF_LINKER_FLAGS)		\
 	           $(SSL_LINKER_FLAGS)			\
 	           $(ZLIB_LINKER_FLAGS)"		\
 	  $(MAKE) $(AM_MAKEFLAGS)			\
+	          EXTRA_CPPFLAGS=-Wno-error		\
 	          HAS_PKG_CONFIG=false			\
 	          NO_PROTOC=false			\
 	          PROTOC=$(PROTOC)


[mesos] 03/04: Added MESOS-9480 to the 1.5.2 CHANGELOG.

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chhsiao pushed a commit to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 8b394415823a214826ca10607f050c61b0085354
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
AuthorDate: Tue Dec 18 14:56:59 2018 -0800

    Added MESOS-9480 to the 1.5.2 CHANGELOG.
---
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG b/CHANGELOG
index 346b35c..19ad7b3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -60,6 +60,7 @@ Release Notes - Mesos - Version 1.5.2
   * [MESOS-9305] - Create cgoup recursively to workaround systemd deleting cgroups_root.
   * [MESOS-9308] - URI disk profile adaptor could deadlock.
   * [MESOS-9334] - Container stuck at ISOLATING state due to libevent poll never returns.
+  * [MESOS-9480] - Master may skip processing authorization results for `LAUNCH_GROUP`.
 
 
 Release Notes - Mesos - Version 1.5.1


[mesos] 02/04: Made master process all authorization results for `LAUNCH_GROUP`.

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chhsiao pushed a commit to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 0bb23bafdf33e05102cb658cef4c9b6d555b9a52
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
AuthorDate: Fri Dec 14 11:01:29 2018 -0800

    Made master process all authorization results for `LAUNCH_GROUP`.
    
    This patch fixes a bug where the master does not complete the processing
    of authorization results for `LAUNCH_GROUP`, causing a subsequent
    operation to drop if one of the remaining authorization is denied.
    
    Review: https://reviews.apache.org/r/69571
---
 src/master/master.cpp | 77 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 43 insertions(+), 34 deletions(-)

diff --git a/src/master/master.cpp b/src/master/master.cpp
index 4626f16..bcc41b3 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -4552,8 +4552,8 @@ void Master::_accept(
   // The order of the conversions is important and preserved.
   vector<ResourceConversion> conversions;
 
-  // The order of `authorizations` must match the order of the operations in
-  // `accept.operations()`, as they are iterated through simultaneously.
+  // The order of `authorizations` must match the order of the operations and/or
+  // tasks in `accept.operations()` as they are iterated through simultaneously.
   CHECK_READY(_authorizations);
   list<Future<bool>> authorizations = _authorizations.get();
 
@@ -4561,6 +4561,7 @@ void Master::_accept(
     switch (operation.type()) {
       // The RESERVE operation allows a principal to reserve resources.
       case Offer::Operation::RESERVE: {
+        CHECK(!authorizations.empty());
         Future<bool> authorization = authorizations.front();
         authorizations.pop_front();
 
@@ -4636,6 +4637,7 @@ void Master::_accept(
 
       // The UNRESERVE operation allows a principal to unreserve resources.
       case Offer::Operation::UNRESERVE: {
+        CHECK(!authorizations.empty());
         Future<bool> authorization = authorizations.front();
         authorizations.pop_front();
 
@@ -4701,6 +4703,7 @@ void Master::_accept(
       }
 
       case Offer::Operation::CREATE: {
+        CHECK(!authorizations.empty());
         Future<bool> authorization = authorizations.front();
         authorizations.pop_front();
 
@@ -4778,6 +4781,7 @@ void Master::_accept(
       }
 
       case Offer::Operation::DESTROY: {
+        CHECK(!authorizations.empty());
         Future<bool> authorization = authorizations.front();
         authorizations.pop_front();
 
@@ -4872,6 +4876,7 @@ void Master::_accept(
 
       case Offer::Operation::LAUNCH: {
         foreach (const TaskInfo& task, operation.launch().task_infos()) {
+          CHECK(!authorizations.empty());
           Future<bool> authorization = authorizations.front();
           authorizations.pop_front();
 
@@ -5090,51 +5095,50 @@ void Master::_accept(
         // TODO(bmahler): Consider injecting some default (cpus, mem, disk)
         // resources when the framework omits the executor resources.
 
-        // See if there are any validation or authorization errors.
+        // See if there are any authorization or validation errors.
         // Note that we'll only report the first error we encounter
         // for the group.
         //
         // TODO(anindya_sinha): If task group uses shared resources, this
         // validation needs to be enhanced to accommodate multiple copies
         // of shared resources across tasks within the task group.
-        Option<Error> error = validation::task::group::validate(
-            taskGroup, executor, framework, slave, _offeredResources);
+        Option<Error> error;
+        Option<TaskStatus::Reason> reason;
 
-        Option<TaskStatus::Reason> reason = None();
-
-        if (error.isSome()) {
-          reason = TaskStatus::REASON_TASK_GROUP_INVALID;
-        } else {
-          foreach (const TaskInfo& task, taskGroup.tasks()) {
-            Future<bool> authorization = authorizations.front();
-            authorizations.pop_front();
-
-            CHECK(!authorization.isDiscarded());
-
-            if (authorization.isFailed()) {
-              error = Error("Failed to authorize task"
-                            " '" + stringify(task.task_id()) + "'"
-                            ": " + authorization.failure());
+        // NOTE: We check for the authorization errors first and never break the
+        // loop to ensure that all authorization futures for this task group are
+        // iterated through.
+        foreach (const TaskInfo& task, taskGroup.tasks()) {
+          CHECK(!authorizations.empty());
+          Future<bool> authorization = authorizations.front();
+          authorizations.pop_front();
 
-              reason = TaskStatus::REASON_TASK_GROUP_UNAUTHORIZED;
+          CHECK(!authorization.isDiscarded());
 
-              break;
+          if (authorization.isFailed()) {
+            error = Error("Failed to authorize task"
+                          " '" + stringify(task.task_id()) + "'"
+                          ": " + authorization.failure());
+          } else if (!authorization.get()) {
+            string user = framework->info.user(); // Default user.
+            if (task.has_command() && task.command().has_user()) {
+              user = task.command().user();
             }
 
-            if (!authorization.get()) {
-              string user = framework->info.user(); // Default user.
-              if (task.has_command() && task.command().has_user()) {
-                user = task.command().user();
-              }
-
-              error = Error("Task '" + stringify(task.task_id()) + "'"
-                            " is not authorized to launch as"
-                            " user '" + user + "'");
+            error = Error("Task '" + stringify(task.task_id()) + "'"
+                          " is not authorized to launch as"
+                          " user '" + user + "'");
+          }
+        }
 
-              reason = TaskStatus::REASON_TASK_GROUP_UNAUTHORIZED;
+        if (error.isSome()) {
+          reason = TaskStatus::REASON_TASK_GROUP_UNAUTHORIZED;
+        } else {
+          error = validation::task::group::validate(
+              taskGroup, executor, framework, slave, _offeredResources);
 
-              break;
-            }
+          if (error.isSome()) {
+            reason = TaskStatus::REASON_TASK_GROUP_INVALID;
           }
         }
 
@@ -5428,6 +5432,11 @@ void Master::_accept(
     }
   }
 
+  CHECK(authorizations.empty())
+    << "Authorization results not processed: "
+    << stringify(
+           vector<Future<bool>>(authorizations.begin(), authorizations.end()));
+
   // Update the allocator based on the operations.
   if (!conversions.empty()) {
     allocator->updateAllocation(