Repository: mesos
Updated Branches:
  refs/heads/master bf6a47fe3 -> 844673405


Fixed master to reject non-subscribe calls made before subscription.

As the design doc says the master should reject non-subscribe calls
if framework hasn't registered yet.

Review: https://reviews.apache.org/r/37511


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/84467340
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/84467340
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/84467340

Branch: refs/heads/master
Commit: 8446734051b2ac0d4098f25f9e44de8631784af2
Parents: bf6a47f
Author: Vinod Kone <[email protected]>
Authored: Mon Aug 17 11:16:54 2015 -0700
Committer: Vinod Kone <[email protected]>
Committed: Mon Aug 17 11:16:54 2015 -0700

----------------------------------------------------------------------
 src/master/http.cpp | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/84467340/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index a73ee17..877c1f9 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -68,6 +68,7 @@ using process::USAGE;
 
 using process::http::Accepted;
 using process::http::BadRequest;
+using process::http::Forbidden;
 using process::http::InternalServerError;
 using process::http::MethodNotAllowed;
 using process::http::NotFound;
@@ -431,6 +432,10 @@ Future<Response> Master::Http::scheduler(const Request& 
request) const
     return BadRequest("Framework cannot be found");
   }
 
+  if (!framework->connected) {
+    return Forbidden("Framework is not subscribed");
+  }
+
   switch (call.type()) {
     case scheduler::Call::TEARDOWN:
       master->removeFramework(framework);

Reply via email to