----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/49555/ -----------------------------------------------------------
(Updated Aug. 26, 2016, 2:11 p.m.) Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Gastón Kleiman, Gilbert Song, Jie Yu, and Timothy Chen. Changes ------- Rebase. Bugs: MESOS-5954 https://issues.apache.org/jira/browse/MESOS-5954 Repository: mesos Description ------- We updated the command executor to use health checks via library in https://reviews.apache.org/r/49389/. This patch updates the docker executor for consistency. Diffs (updated) ----- src/docker/executor.cpp 8d679cd33b6ddf3a5c11bb8c458a97b8809473ac Diff: https://reviews.apache.org/r/49555/diff/ Testing ------- Test with Marathon locally. # 1. Success case. I start `sleep 200` with the Docker container and use `ls /mnt/mesos/sandbox` as the health check command. According the qurey result of `http://localhost:8080/v2/apps/test-sleep`, could see Marathon receive healthy status. ``` # truncate unnecessary messages { "app": { "id": "/test-health", "cmd": "sleep 200", "container": { "type": "DOCKER", "volumes": [], "docker": { "image": "ubuntu", "network": "HOST" } }, "healthChecks": [ { "protocol": "COMMAND", "command": { "value": "ls /mnt/mesos/sandbox" }, "gracePeriodSeconds": 300, "intervalSeconds": 60, "timeoutSeconds": 20, "maxConsecutiveFailures": 3 } ], "tasksStaged": 0, "tasksRunning": 1, "tasksHealthy": 1, "tasksUnhealthy": 0, "tasks": [ { "id": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5", "slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0", "host": "127.0.0.1", "startedAt": "2016-08-02T02:55:23.433Z", "stagedAt": "2016-08-02T02:55:21.217Z", "version": "2016-08-02T02:48:31.054Z", "ipAddresses": [ { "ipAddress": "127.0.0.1", "protocol": "IPv4" } ], "appId": "/test-health", "healthCheckResults": [ { "alive": true, "consecutiveFailures": 0, "firstSuccess": "2016-08-02T02:55:23.652Z", "lastFailure": null, "lastSuccess": "2016-08-02T02:55:23.652Z", "lastFailureCause": null, "taskId": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5" } ] } ] } } ``` # 2. Failed case. Then I start a similar application which use `false` as health check command, could see Marathon receive unhealthy status. ``` # truncate unnecessary messages { "app": { "id": "/test-unhealth", "cmd": "sleep 200", "container": { "type": "DOCKER", "volumes": [], "docker": { "image": "ubuntu", "network": "HOST" } }, "healthChecks": [ { "protocol": "COMMAND", "command": { "value": "false" }, "gracePeriodSeconds": 5, "intervalSeconds": 3, "timeoutSeconds": 20, "maxConsecutiveFailures": 3 } ], "tasksStaged": 0, "tasksRunning": 1, "tasksHealthy": 0, "tasksUnhealthy": 1, "tasks": [ { "id": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5", "slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0", "host": "127.0.0.1", "startedAt": "2016-08-02T03:07:47.310Z", "stagedAt": "2016-08-02T03:07:45.041Z", "ipAddresses": [ { "ipAddress": "127.0.0.1", "protocol": "IPv4" } ], "appId": "/test-unhealth", "healthCheckResults": [ { "alive": false, "consecutiveFailures": 1, "firstSuccess": null, "lastFailure": "2016-08-02T03:07:53.800Z", "lastSuccess": null, "lastFailureCause": "", "taskId": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5" } ] } ] } } ``` Thanks, haosdent huang