You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2019/01/30 15:02:48 UTC

[mesos] branch 1.5.x updated (ccd01d7 -> edebf36)

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

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


    from ccd01d7  Added MESOS-9532 to 1.5.3 CHANGELOG.
     new 5f21540  Fixed scheduler library on multiple SUBSCRIBE requests per connection.
     new edebf36  Added MESOS-9210 to 1.5.3 CHANGELOG.

The 2 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:
 CHANGELOG                   |  1 +
 src/scheduler/scheduler.cpp | 40 +++++++++++++++++++++-------------------
 2 files changed, 22 insertions(+), 19 deletions(-)


[mesos] 01/02: Fixed scheduler library on multiple SUBSCRIBE requests per connection.

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

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

commit 5f21540e5f45d05e7b5c4450f5074bc30d254fa1
Author: Till Toenshoff <to...@me.com>
AuthorDate: Wed Jan 30 13:51:34 2019 +0100

    Fixed scheduler library on multiple SUBSCRIBE requests per connection.
    
    The HTTP scheduler API dictates that on a single connection, the
    scheduler may only send a single SUBSCRIBE request. Due to recent
    authentication related changes, this contract got broken. This patch
    restores the contract.
    
    Review: https://reviews.apache.org/r/69839/
    
    (cherry picked from commit a5b9fcafbdf8663707e19c818be8a2da1eff8622)
---
 src/scheduler/scheduler.cpp | 40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/src/scheduler/scheduler.cpp b/src/scheduler/scheduler.cpp
index 07d2b37..1342d90 100644
--- a/src/scheduler/scheduler.cpp
+++ b/src/scheduler/scheduler.cpp
@@ -230,22 +230,6 @@ public:
       return;
     }
 
-    if (call.type() == Call::SUBSCRIBE && state != CONNECTED) {
-      // It might be possible that the scheduler is retrying. We drop the
-      // request if we have an ongoing subscribe request in flight or if the
-      // scheduler is already subscribed.
-      drop(call, "Scheduler is in state " + stringify(state));
-      return;
-    }
-
-    if (call.type() != Call::SUBSCRIBE && state != SUBSCRIBED) {
-      // We drop all non-subscribe calls if we are not currently subscribed.
-      drop(call, "Scheduler is in state " + stringify(state));
-      return;
-    }
-
-    VLOG(1) << "Sending " << call.type() << " call to " << master.get();
-
     // TODO(vinod): Add support for sending MESSAGE calls directly
     // to the slave, instead of relaying it through the master, as
     // the scheduler driver does.
@@ -258,6 +242,9 @@ public:
     request.headers = {{"Accept", stringify(contentType)},
                        {"Content-Type", stringify(contentType)}};
 
+    VLOG(1) << "Adding authentication headers to " << call.type() << " call to "
+            << master.get();
+
     // TODO(tillt): Add support for multi-step authentication protocols.
     authenticatee->authenticate(request, credential)
       .onAny(defer(self(), &Self::_send, call, lambda::_1));
@@ -540,9 +527,22 @@ protected:
   void _send(const Call& call, const Future<process::http::Request>& future)
   {
     if (!future.isReady()) {
-      LOG(ERROR) << "HTTP authenticatee "
-                 << (future.isFailed() ? "failed: " + future.failure()
-                                       : "discarded");
+      LOG(ERROR) << "HTTP authenticatee failed while adding authentication"
+                 << " header to request: " << future;
+      return;
+    }
+
+    if (call.type() == Call::SUBSCRIBE && state != CONNECTED) {
+      // It might be possible that the scheduler is retrying. We drop the
+      // request if we have an ongoing subscribe request in flight or if the
+      // scheduler is already subscribed.
+      drop(call, "Scheduler is in state " + stringify(state));
+      return;
+    }
+
+    if (call.type() != Call::SUBSCRIBE && state != SUBSCRIBED) {
+      // We drop all non-subscribe calls if we are not currently subscribed.
+      drop(call, "Scheduler is in state " + stringify(state));
       return;
     }
 
@@ -553,6 +553,8 @@ protected:
       return;
     }
 
+    VLOG(1) << "Sending " << call.type() << " call to " << master.get();
+
     Future<process::http::Response> response;
     if (call.type() == Call::SUBSCRIBE) {
       state = SUBSCRIBING;


[mesos] 02/02: Added MESOS-9210 to 1.5.3 CHANGELOG.

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

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

commit edebf363e9ba4f10317e23d068f0fa1a94038a42
Author: Till Toenshoff <to...@me.com>
AuthorDate: Wed Jan 30 06:41:27 2019 +0100

    Added MESOS-9210 to 1.5.3 CHANGELOG.
---
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG b/CHANGELOG
index 30aa0f8..bbfe4ca 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,7 @@ Release Notes - Mesos - Version 1.5.3 (WIP)
 * This is a bug fix release.
 
 ** Bug
+  * [MESOS-9210] - Mesos v1 scheduler library does not properly handle SUBSCRIBE retries.
   * [MESOS-9532] - ResourceOffersTest.ResourceOfferWithMultipleSlaves is flaky.