mesos git commit: Fixed the flaky SlaveRecoveryTest.* failures upon TearDown.

2016-08-08 Thread bmahler
Repository: mesos
Updated Branches:
  refs/heads/master ffafe9b23 -> 8c4a0144a


Fixed the flaky SlaveRecoveryTest.* failures upon TearDown.

During TearDown of ContainerizerTest,
we attempt to destroy all cgroups that we can find within the
cgroup root. We observed in CI that on some distributions it
appears that the freeze is not instantaneous and the freezer
delay is needed to complete the destroy process. Howevever,
the clock may be paused at this point which can lead to the
TearDown failing to destroy!

There does not appear to be a listener hook to run code before
test tear down, so a one-off Clock::resume here seems to be the
simplest route.

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


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

Branch: refs/heads/master
Commit: 8c4a0144af6a8efc358a6b6798bbcec05afb4402
Parents: ffafe9b
Author: Benjamin Mahler 
Authored: Mon Aug 8 18:32:02 2016 -0700
Committer: Benjamin Mahler 
Committed: Mon Aug 8 22:57:42 2016 -0700

--
 src/tests/mesos.cpp | 12 
 1 file changed, 12 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/8c4a0144/src/tests/mesos.cpp
--
diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
index 30492d7..62e8fcc 100644
--- a/src/tests/mesos.cpp
+++ b/src/tests/mesos.cpp
@@ -971,7 +971,19 @@ void 
ContainerizerTest::TearDown()
   foreach (const string& cgroup, cgroups.get()) {
 // Remove any cgroups that start with TEST_CGROUPS_ROOT.
 if (strings::startsWith(cgroup, TEST_CGROUPS_ROOT)) {
+  // Cgroup destruction relies on `delay`s,
+  // so we must ensure the clock is resumed.
+  bool paused = Clock::paused();
+
+  if (paused) {
+Clock::resume();
+  }
+
   AWAIT_READY(cgroups::destroy(hierarchy, cgroup));
+
+  if (paused) {
+Clock::pause();
+  }
 }
   }
 }



mesos git commit: Added new contributor (Gaojin CAO).

2016-08-08 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master c81ddb641 -> ffafe9b23


Added new contributor (Gaojin CAO).

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


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

Branch: refs/heads/master
Commit: ffafe9b232c64e0efe73e62c851914301c542515
Parents: c81ddb6
Author: Gaojin CAO 
Authored: Mon Aug 8 14:57:07 2016 -0700
Committer: Vinod Kone 
Committed: Mon Aug 8 14:57:07 2016 -0700

--
 docs/contributors.yaml | 8 
 1 file changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/ffafe9b2/docs/contributors.yaml
--
diff --git a/docs/contributors.yaml b/docs/contributors.yaml
index 7114bd6..e57ccba 100644
--- a/docs/contributors.yaml
+++ b/docs/contributors.yaml
@@ -125,6 +125,14 @@
   jira_user: darroyo
   reviewboard_user: darroyo
 
+- name: Gaojin CAO
+  affiliations:
+- {organization: chinamobile}
+  emails:
+- caogao...@cmss.chinamobile.com
+  jira_user: cgj
+  reviewboard_user: cgj
+
 - name: Gaston Kleiman
   affiliations:
 - {organization: Mesosphere}



mesos git commit: Added MESOS-5986 to the 1.0.1 CHANGELOG.

2016-08-08 Thread bmahler
Repository: mesos
Updated Branches:
  refs/heads/master 4aca731d3 -> c81ddb641


Added MESOS-5986 to the 1.0.1 CHANGELOG.


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

Branch: refs/heads/master
Commit: c81ddb64145101c9ef646fa160d5b59d46920476
Parents: 4aca731
Author: Benjamin Mahler 
Authored: Mon Aug 8 11:32:23 2016 -0700
Committer: Benjamin Mahler 
Committed: Mon Aug 8 11:34:16 2016 -0700

--
 CHANGELOG | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/c81ddb64/CHANGELOG
--
diff --git a/CHANGELOG b/CHANGELOG
index aec5e53..873f594 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -16,6 +16,8 @@ All Issues:
   * [MESOS-5945] - NvidiaVolume::create() should check for root before 
creating volume.
   * [MESOS-5959] - All non-root tests fail on GPU machine.
   * [MESOS-5982] - NvidiaVolume errors out if any Nvidia binary is missing.
+  * [MESOS-5986] - SSL Socket CHECK can fail after socket receives EOF.
+
 
 Release Notes - Mesos - Version 1.0.0
 



[1/2] mesos git commit: Removed incorrect CHECK in SSL socket `send()`.

2016-08-08 Thread bmahler
Repository: mesos
Updated Branches:
  refs/heads/1.0.x 48d728873 -> ea5151b2c


Removed incorrect CHECK in SSL socket `send()`.

The lambda placed on the event loop by the libevent SSL
socket's `send()` method previously used a `CHECK` to
ensure that the socket's `send_request` member was not
`nullptr`. This patch removes this check, since
`send_request` may become `nullptr` any time the socket
receives an EOF or ERROR event.

Note that the current handling of events is incorrect
also, but we do not attempt a fix here. To be specific,
reading EOF should not deal with send requests at all
(see MESOS-5999). Also, the ERROR events are not
differentiated between reading and writing. Lastly,
when we receive an EOF we do not ensure that the caller
can read the bytes that remain in the buffer!

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


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

Branch: refs/heads/1.0.x
Commit: b1dab04e00b02bf7a65e93bc74d66aeb0ca8d28a
Parents: 48d7288
Author: Greg Mann 
Authored: Fri Aug 5 18:19:33 2016 -0700
Committer: Benjamin Mahler 
Committed: Mon Aug 8 11:31:05 2016 -0700

--
 3rdparty/libprocess/src/libevent_ssl_socket.cpp | 48 ++--
 1 file changed, 34 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/b1dab04e/3rdparty/libprocess/src/libevent_ssl_socket.cpp
--
diff --git a/3rdparty/libprocess/src/libevent_ssl_socket.cpp 
b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
index 9212b19..57a63f6 100644
--- a/3rdparty/libprocess/src/libevent_ssl_socket.cpp
+++ b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
@@ -337,6 +337,12 @@ void LibeventSSLSocketImpl::event_callback(short events)
   // In all of the following conditions, we're interested in swapping
   // the value of the requests with null (if they are already null,
   // then there's no harm).
+  //
+  // TODO(bmahler): If we receive an EOF because the receiving
+  // side only shutdown writes on its socket, we can technically
+  // still send data on the socket!
+  //   See: http://www.unixguide.net/network/socketfaq/2.6.shtml
+  //   Related JIRA: MESOS-5999
   if (events & BEV_EVENT_EOF ||
   events & BEV_EVENT_CONNECTED ||
   events & BEV_EVENT_ERROR) {
@@ -696,14 +702,21 @@ Future LibeventSSLSocketImpl::send(const char* 
data, size_t size)
 CHECK(__in_event_loop__);
 CHECK(self);
 
-// We check that send_request is valid, because we do not
-// allow discards. This means there is no race between the
-// entry of 'send' and the execution of this lambda.
+// Check if the socket is closed or the write end has
+// encountered an error in the interim (i.e. we received
+// a BEV_EVENT_ERROR with BEV_EVENT_WRITING).
+bool write = false;
+
 synchronized (self->lock) {
-  CHECK_NOTNULL(self->send_request.get());
+  if (self->send_request.get() != nullptr) {
+write = true;
+  }
 }
 
-bufferevent_write(self->bev, data, size);
+if (write) {
+  int result = bufferevent_write(self->bev, data, size);
+  CHECK_EQ(0, result);
+}
   },
   DISALLOW_SHORT_CIRCUIT);
 
@@ -740,18 +753,25 @@ Future LibeventSSLSocketImpl::sendfile(
 CHECK(__in_event_loop__);
 CHECK(self);
 
-// We check that send_request is valid, because we do not
-// allow discards. This means there is no race between the
-// entry of 'sendfile' and the execution of this lambda.
+// Check if the socket is closed or the write end has
+// encountered an error in the interim (i.e. we received
+// a BEV_EVENT_ERROR with BEV_EVENT_WRITING).
+bool write = false;
+
 synchronized (self->lock) {
-  CHECK_NOTNULL(self->send_request.get());
+  if (self->send_request.get() != nullptr) {
+write = true;
+  }
 }
 
-evbuffer_add_file(
-bufferevent_get_output(self->bev),
-fd,
-offset,
-size);
+if (write) {
+  int result = evbuffer_add_file(
+  bufferevent_get_output(self->bev),
+  fd,
+  offset,
+  size);
+  CHECK_EQ(0, result);
+}
   },
   DISALLOW_SHORT_CIRCUIT);
 



[2/2] mesos git commit: Added MESOS-5986 to the 1.0.1 CHANGELOG.

2016-08-08 Thread bmahler
Added MESOS-5986 to the 1.0.1 CHANGELOG.


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

Branch: refs/heads/1.0.x
Commit: ea5151b2ce20d0ae1ed794a538bc2fe7e7ef4732
Parents: b1dab04
Author: Benjamin Mahler 
Authored: Mon Aug 8 11:32:23 2016 -0700
Committer: Benjamin Mahler 
Committed: Mon Aug 8 11:32:23 2016 -0700

--
 CHANGELOG | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/ea5151b2/CHANGELOG
--
diff --git a/CHANGELOG b/CHANGELOG
index 0191a09..2870d19 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -16,6 +16,8 @@ All Issues:
   * [MESOS-5945] - NvidiaVolume::create() should check for root before 
creating volume.
   * [MESOS-5959] - All non-root tests fail on GPU machine.
   * [MESOS-5982] - NvidiaVolume errors out if any Nvidia binary is missing.
+  * [MESOS-5986] - SSL Socket CHECK can fail after socket receives EOF.
+
 
 Release Notes - Mesos - Version 1.0.0
 



mesos git commit: Fixed two typos in port mapping isolator tests.

2016-08-08 Thread jieyu
Repository: mesos
Updated Branches:
  refs/heads/master 3a2a68522 -> 4aca731d3


Fixed two typos in port mapping isolator tests.


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

Branch: refs/heads/master
Commit: 4aca731d30da8e1da64f1636d4873c2c6941563f
Parents: 3a2a685
Author: Jie Yu 
Authored: Mon Aug 8 09:50:43 2016 -0700
Committer: Jie Yu 
Committed: Mon Aug 8 09:50:47 2016 -0700

--
 src/tests/containerizer/port_mapping_tests.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/4aca731d/src/tests/containerizer/port_mapping_tests.cpp
--
diff --git a/src/tests/containerizer/port_mapping_tests.cpp 
b/src/tests/containerizer/port_mapping_tests.cpp
index 94d6d75..dddcb63 100644
--- a/src/tests/containerizer/port_mapping_tests.cpp
+++ b/src/tests/containerizer/port_mapping_tests.cpp
@@ -1502,7 +1502,7 @@ TEST_F(PortMappingIsolatorTest, ROOT_NC_SmallEgressLimit)
   // neither 'ports' nor 'ephemeral_ports', which makes it a good port
   // to use on the host.
   ostringstream command1;
-  command1 << "nc -l localhost " << invalidPort << " > /devnull";
+  command1 << "nc -l localhost " << invalidPort << " > /dev/null";
   Try s = subprocess(command1.str().c_str());
   CHECK_SOME(s);
 
@@ -1666,7 +1666,7 @@ TEST_F(PortMappingIsolatorTest, 
ROOT_NC_PortMappingStatistics)
   // connections to the localhost IP are filtered out when retrieving
   // the RTT information inside containers.
   ostringstream command1;
-  command1 << "nc -l " << hostIP << " " << invalidPort << " > /devnull";
+  command1 << "nc -l " << hostIP << " " << invalidPort << " > /dev/null";
   Try s = subprocess(command1.str().c_str());
   CHECK_SOME(s);
 



mesos git commit: Added `-Wsign-compare` to global compiler flags.

2016-08-08 Thread mpark
Repository: mesos
Updated Branches:
  refs/heads/master d95fba4c5 -> 3a2a68522


Added `-Wsign-compare` to global compiler flags.

Mesos already builds with the `-Wall` and `-Werror` flags.
However, different compilers have different sets of checks for `-Wall`.

This change explicitly adds the `-Wsign-compare` warning flag that is
present in GCC's `-Wall`, but not in Clang.

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


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

Branch: refs/heads/master
Commit: 3a2a68522bb39473c9ee62fd8455fa8f24f1d2b1
Parents: d95fba4
Author: Joseph Wu 
Authored: Fri Aug 5 14:10:29 2016 +0200
Committer: Michael Park 
Committed: Mon Aug 8 17:40:16 2016 +0200

--
 src/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/3a2a6852/src/Makefile.am
--
diff --git a/src/Makefile.am b/src/Makefile.am
index 1a9b083..39e3199 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -99,7 +99,7 @@ AM_LIBS = $(PTHREAD_LIBS)
 
 # Setup CPPFLAGS that are used for most source files.
 MESOS_CPPFLAGS = $(AM_CPPFLAGS)
-MESOS_CPPFLAGS += -Wall -Werror
+MESOS_CPPFLAGS += -Wall -Werror -Wsign-compare
 MESOS_CPPFLAGS += -DLIBDIR=\"$(libdir)\"
 MESOS_CPPFLAGS += -DPKGLIBEXECDIR=\"$(pkglibexecdir)\"
 MESOS_CPPFLAGS += -DPKGDATADIR=\"$(pkgdatadir)\"



mesos git commit: Added new contributor (Will Rouesnel).

2016-08-08 Thread anand
Repository: mesos
Updated Branches:
  refs/heads/master fce6bc815 -> d95fba4c5


Added new contributor (Will Rouesnel).

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


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

Branch: refs/heads/master
Commit: d95fba4c5bdd1af9b505f61ce5a57a5cf50dbed9
Parents: fce6bc8
Author: Will Rouesnel 
Authored: Mon Aug 8 08:27:40 2016 -0700
Committer: Anand Mazumdar 
Committed: Mon Aug 8 08:27:40 2016 -0700

--
 docs/contributors.yaml | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/d95fba4c/docs/contributors.yaml
--
diff --git a/docs/contributors.yaml b/docs/contributors.yaml
index fdb21d4..7114bd6 100644
--- a/docs/contributors.yaml
+++ b/docs/contributors.yaml
@@ -511,3 +511,9 @@
 - s.dhilipku...@gmail.com
   jira_user: dhilipkumars
   reviewboard_user: dhilipkumars
+
+- name: Will Rouesnel
+  emails:
+- w.roues...@gmail.com
+  jira_user: wrouesnel
+  reviewboard_user: wrouesnel



mesos git commit: Updated `HealthCheck` protobuf with HTTP and TCP health checks.

2016-08-08 Thread alexr
Repository: mesos
Updated Branches:
  refs/heads/master f5822f3c1 -> fce6bc815


Updated `HealthCheck` protobuf with HTTP and TCP health checks.

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


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

Branch: refs/heads/master
Commit: fce6bc81550211dfeabcc8508d267c71cf4a6fff
Parents: f5822f3
Author: haosdent huang 
Authored: Mon Aug 8 12:33:35 2016 +0200
Committer: Alexander Rukletsov 
Committed: Mon Aug 8 13:07:53 2016 +0200

--
 include/mesos/mesos.proto| 60 +++
 include/mesos/v1/mesos.proto | 60 +++
 2 files changed, 84 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/fce6bc81/include/mesos/mesos.proto
--
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 8c74d0b..6fd8363 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -318,41 +318,56 @@ 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; currently only 'command' is supported.
- * Specifying more than one strategy is an error.
+ * optional fields. Specifying more than one strategy is an error.
  */
 message HealthCheck {
-  // Describes an HTTP health check. This is not fully implemented and not
-  // recommended for use - see MESOS-2533.
-  message HTTP {
+  enum Type {
+UNKNOWN = 0;
+COMMAND = 1;
+HTTP = 2;
+TCP = 3;
+  }
+
+  // Describes an HTTP health check. Sends a GET request to
+  // scheme://:port/path. Return codes between 200 and 399 are treated
+  // as success, failure otherwise. Note that  is not configurable
+  // and is resolved automatically, in most cases to localhost.
+  message HTTPCheckInfo {
+// Currently "http" and "https" are supported.
+optional string scheme = 1;
+
 // Port to send the HTTP request.
-required uint32 port = 1;
+required uint32 port = 2;
 
 // HTTP request path.
-optional string path = 2 [default = "/"];
+optional string path = 3;
+
+// TODO(alexr): Add support for HTTP method. While adding POST
+// and PUT is simple, supporting payload is more involved.
 
-// TODO(benh): Implement:
-// Whether or not to use HTTPS.
-// optional bool ssl = 3 [default = false];
+// TODO(alexr): Add support for custom HTTP headers.
 
-// Expected response statuses. Not specifying any statuses implies
-// that any returned status is acceptable.
-repeated uint32 statuses = 4;
+// TODO(alexr): Add support for success and possibly failure
+// statuses.
+
+// TODO(haosdent): Consider adding a flag to enable task's certificate
+// validation for HTTPS health checks, see MESOS-5997.
 
 // TODO(benh): Include an 'optional bytes data' field for checking
 // for specific data in the response.
   }
 
-  // HTTP health check - not yet recommended for use, see MESOS-2533.
-  optional HTTP http = 1;
+  // Describes a TCP health check, i.e. based on establishing
+  // a TCP connection to the specified port.
+  message TCPCheckInfo {
+// Port expected to be open.
+required uint32 port = 1;
+  }
 
   // TODO(benh): Consider adding a URL health check strategy which
   // allows doing something similar to the HTTP strategy but
   // encapsulates all the details in a single string field.
 
-  // TODO(benh): Other possible health check strategies could include
-  // one for TCP/UDP.
-
   // Amount of time to wait until starting the health checks.
   optional double delay_seconds = 2 [default = 15.0];
 
@@ -371,8 +386,17 @@ message HealthCheck {
   // TODO(alexr): Add an optional `KillPolicy` that should be used
   // if the task is killed because of a health check failure.
 
+  // The type of health check.
+  optional Type type = 8;
+
   // Command health check.
   optional CommandInfo command = 7;
+
+  // HTTP health check.
+  optional HTTPCheckInfo http = 1;
+
+  // TCP health check.
+  optional TCPCheckInfo tcp = 9;
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/fce6bc81/include/mesos/v1/mesos.proto
--
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index 94b59dd..85468f8 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -318,41 +318,56 @@ message FrameworkInfo {
 /**
  * Describes a health check for a task or executor (or any arbitrary
  * process/command). A "strat