Hello everyone,

As you all probably know by now, Greg and I are working on enabling operation
feedback <https://issues.apache.org/jira/browse/MESOS-8054> for frameworks.

I implemented a new ReconcileOperations scheduler API call
<https://reviews.apache.org/r/66464/>, which will allow frameworks to get
the latest operation status sent to the framework, and to find out if the
agent (and external resource provider in the future) performing an
operation is unreachable, marked gone, etc.

This is the first scheduler API call that follows the “Request/Response”
pattern, i.e., the master will synchronously respond with a
mesos::v1::scheduler::Response protobuf message instead of via events. This
allows a scheduler to unambiguously associate status updates with a
particular reconciliation call, which is not possible with the Call/Event
pattern.

Our C++ Scheduler API client implements a void send()
<https://github.com/apache/mesos/blob/1c939124e93191d190776fccdbd52a74989c4dfa/include/mesos/v1/scheduler.hpp#L50>
method that doesn’t return the response from the master. I’m adding a new
method that will make it possible for users of the library to get that
response.

This method can be implemented in many ways, so I’d like to get your
opinion.

Note: this method will initially be used only by tests, but we might want
to use it if we update our Java bindings to support the “Request/Response”
pattern.

Option #1

process::Future<APIResult>> call(const Call& callMessage)

Where APIResult is a new protobuf message in the mesos.v1.scheduler package
with the following definition:

message APIResult {

 message Status {

   required uint32 status = 1; // HTTP status code

   optional string error = 2; // Body of the HTTP response

 }

 required Status status = 1;

 // The deserialized `v1.scheduler.Response` message.

 //

 // Note: this field is optional, because the master's response to most API

 // calls has a `202 Accepted` status code and an empty body.

 optional Response response = 2;

}

Advantages

   -

   It is possible to know whether the server answered with 200 or with 202.
   -

   It is easy to know if the server’s response included a
   mesos.v1.scheduler.Response


Option #2

process::Future<APIResult>> call(const Call& callMessage)

Where APIResult is a new protobuf message in the mesos.v1.scheduler package
with the following definition:

message APIResult {

 message Error {

   required uint32 status = 1; // HTTP status code

   optional string message = 2; // Body of the HTTP response

 }

 optional Error error = 1;

 optional Response response = 2; // mesos.v1.scheduler.Response

}

Note: if the server responds with “202 Accepted” and an empty body, then
both fields will be empty

Please take a look and let me know what you think!

Thanks,

-Gastón

Reply via email to