This is an automated email from the ASF dual-hosted git repository.
bmahler 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 0a08e1b Clarified ERROR event as first event in the scheduler HTTP
API docs.
0a08e1b is described below
commit 0a08e1bd2e57fdab1c4565d8bb5aa49ea621705a
Author: Benjamin Mahler <[email protected]>
AuthorDate: Mon Jun 17 18:46:22 2019 -0400
Clarified ERROR event as first event in the scheduler HTTP API docs.
The ERROR event is also possible as the first event in the streaming
response from the master, but this is not clear in the documentation
as pointed out by James DeFelice ([email protected]).
Review: https://reviews.apache.org/r/70868
---
docs/scheduler-http-api.md | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/docs/scheduler-http-api.md b/docs/scheduler-http-api.md
index a5327c2..9831d52 100644
--- a/docs/scheduler-http-api.md
+++ b/docs/scheduler-http-api.md
@@ -55,7 +55,7 @@ The response returned from the `SUBSCRIBE` call (see
[below](#subscribe)) is enc
This is the first step in the communication process between the scheduler and
the master. This is also to be considered as subscription to the "/scheduler"
event stream.
-To subscribe with the master, the scheduler sends an HTTP POST with a
`SUBSCRIBE` message including the required FrameworkInfo. Note that if
"subscribe.framework_info.id" and "FrameworkID" are not set, the master
considers the scheduler as a new one and subscribes it by assigning it a
FrameworkID. The HTTP response is a stream in RecordIO format; the event stream
begins with a `SUBSCRIBED` event (see details in **Events** section). The
response also includes the `Mesos-Stream-Id` header, [...]
+To subscribe with the master, the scheduler sends an HTTP POST with a
`SUBSCRIBE` message including the required FrameworkInfo. Note that if
"subscribe.framework_info.id" and "FrameworkID" are not set, the master
considers the scheduler as a new one and subscribes it by assigning it a
FrameworkID. The HTTP response is a stream in RecordIO format; the event stream
begins with either a `SUBSCRIBED` event or an `ERROR` event (see details in
**Events** section). The response also includes th [...]
```
SUBSCRIBE Request (JSON):
@@ -501,7 +501,7 @@ Schedulers are expected to keep a **persistent** connection
to the "/scheduler"
The following events are currently sent by the master. The canonical source of
this information is at
[scheduler.proto](https://github.com/apache/mesos/blob/master/include/mesos/v1/scheduler/scheduler.proto).
Note that when sending JSON encoded events, master encodes raw bytes in Base64
and strings in UTF-8.
### SUBSCRIBED
-The first event sent by the master when the scheduler sends a `SUBSCRIBE`
request on the persistent connection. See `SUBSCRIBE` in Calls section for the
format.
+The first event sent by the master when the scheduler sends a `SUBSCRIBE`
request, if authorization / validation succeeds. See `SUBSCRIBE` in Calls
section for the format.
### OFFERS
@@ -638,7 +638,12 @@ FAILURE Event (JSON)
```
### ERROR
-Sent by the master when an asynchronous error event is generated (e.g., a
framework is not authorized to subscribe with one of the given roles). It is
recommended that the framework abort when it receives an error and retry
subscription as necessary.
+Can be sent either:
+
+* As the first event (in lieu of `SUBSCRIBED`) when the scheduler's
`SUBSCRIBE` request is invalid (e.g. invalid `FrameworkInfo`) or unauthorized
(e.g., a framework is not authorized to subscribe with some of the given
`FrameworkInfo.roles`).
+* When an asynchronous error event is generated (e.g. the master detects a
newer subscription from a failed over instance of the scheduler).
+
+It is recommended that the framework abort when it receives an error and retry
subscription as necessary.
```
ERROR Event (JSON)