Repository: mesos Updated Branches: refs/heads/master a17ae964e -> d7b1b667d
Ensured `HealthCheck::HTTPCheckInfo` compatible with the old one. Review: https://reviews.apache.org/r/51803/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0a52cf7e Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0a52cf7e Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0a52cf7e Branch: refs/heads/master Commit: 0a52cf7ea715f146ff581b82a8fd6efda15c208a Parents: a17ae96 Author: haosdent huang <haosd...@gmail.com> Authored: Thu Sep 29 17:27:08 2016 +0200 Committer: Alexander Rukletsov <al...@apache.org> Committed: Thu Sep 29 17:27:08 2016 +0200 ---------------------------------------------------------------------- include/mesos/mesos.proto | 27 ++++++++++++++++++--------- include/mesos/v1/mesos.proto | 27 ++++++++++++++++++--------- 2 files changed, 36 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/0a52cf7e/include/mesos/mesos.proto ---------------------------------------------------------------------- diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto index 2209ea2..e71a583 100644 --- a/include/mesos/mesos.proto +++ b/include/mesos/mesos.proto @@ -335,8 +335,8 @@ message FrameworkInfo { /** * Describes a health check for a task or executor (or any arbitrary - * process/command). A "strategy" is picked by specifying one of the - * optional fields. Specifying more than one strategy is an error. + * process/command). A type is picked by specifying one of the + * optional fields. Specifying more than one type is an error. */ message HealthCheck { enum Type { @@ -347,18 +347,19 @@ message HealthCheck { } // Describes an HTTP health check. Sends a GET request to - // scheme://<host>:port/path. Return codes between 200 and 399 are treated - // as success, failure otherwise. Note that <host> is not configurable - // and is resolved automatically, in most cases to localhost. + // scheme://<host>:port/path. Note that <host> is not configurable and is + // resolved automatically, in most cases to 127.0.0.1. Default executors + // treat return codes between 200 and 399 as success; custom executors + // may employ a different strategy, e.g. leveraging the `statuses` field. message HTTPCheckInfo { // Currently "http" and "https" are supported. - optional string scheme = 1; + optional string scheme = 3; // Port to send the HTTP request. - required uint32 port = 2; + required uint32 port = 1; // HTTP request path. - optional string path = 3; + optional string path = 2; // TODO(alexr): Add support for HTTP method. While adding POST // and PUT is simple, supporting payload is more involved. @@ -368,6 +369,14 @@ message HealthCheck { // TODO(alexr): Add support for success and possibly failure // statuses. + // NOTE: It is up to the custom executor to interpret and act on this + // field. Setting this field has no effect on the default executors. + // + // TODO(haosdent): Deprecate this field when we add better support for + // success and possibly failure statuses, e.g. ranges of success and + // failure statuses. + repeated uint32 statuses = 4; + // TODO(haosdent): Consider adding a flag to enable task's certificate // validation for HTTPS health checks, see MESOS-5997. @@ -411,7 +420,7 @@ message HealthCheck { optional CommandInfo command = 7; // HTTP health check. - optional HTTPCheckInfo http = 10; + optional HTTPCheckInfo http = 1; // TCP health check. optional TCPCheckInfo tcp = 9; http://git-wip-us.apache.org/repos/asf/mesos/blob/0a52cf7e/include/mesos/v1/mesos.proto ---------------------------------------------------------------------- diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto index 00c6234..e7b8a0f 100644 --- a/include/mesos/v1/mesos.proto +++ b/include/mesos/v1/mesos.proto @@ -335,8 +335,8 @@ message FrameworkInfo { /** * Describes a health check for a task or executor (or any arbitrary - * process/command). A "strategy" is picked by specifying one of the - * optional fields. Specifying more than one strategy is an error. + * process/command). A type is picked by specifying one of the + * optional fields. Specifying more than one type is an error. */ message HealthCheck { enum Type { @@ -347,18 +347,19 @@ message HealthCheck { } // Describes an HTTP health check. Sends a GET request to - // scheme://<host>:port/path. Return codes between 200 and 399 are treated - // as success, failure otherwise. Note that <host> is not configurable - // and is resolved automatically, in most cases to localhost. + // scheme://<host>:port/path. Note that <host> is not configurable and is + // resolved automatically, in most cases to 127.0.0.1. Default executors + // treat return codes between 200 and 399 as success; custom executors + // may employ a different strategy, e.g. leveraging the `statuses` field. message HTTPCheckInfo { // Currently "http" and "https" are supported. - optional string scheme = 1; + optional string scheme = 3; // Port to send the HTTP request. - required uint32 port = 2; + required uint32 port = 1; // HTTP request path. - optional string path = 3; + optional string path = 2; // TODO(alexr): Add support for HTTP method. While adding POST // and PUT is simple, supporting payload is more involved. @@ -368,6 +369,14 @@ message HealthCheck { // TODO(alexr): Add support for success and possibly failure // statuses. + // NOTE: It is up to the custom executor to interpret and act on this + // field. Setting this field has no effect on the default executors. + // + // TODO(haosdent): Deprecate this field when we add better support for + // success and possibly failure statuses, e.g. ranges of success and + // failure statuses. + repeated uint32 statuses = 4; + // TODO(haosdent): Consider adding a flag to enable task's certificate // validation for HTTPS health checks, see MESOS-5997. @@ -411,7 +420,7 @@ message HealthCheck { optional CommandInfo command = 7; // HTTP health check. - optional HTTPCheckInfo http = 10; + optional HTTPCheckInfo http = 1; // TCP health check. optional TCPCheckInfo tcp = 9;