You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2018/06/26 16:11:06 UTC
[1/3] mesos git commit: Updated CNI slave recovery test.
Repository: mesos
Updated Branches:
refs/heads/1.6.x a343aca88 -> 638ba9759
Updated CNI slave recovery test.
Updated the test so that it can catch regression described in
MESOS-9025. This test fails without the fix for MESOS-9025 and passes
after the fix.
Review: https://reviews.apache.org/r/67737
(cherry picked from commit 018695b88a6ada5e90cae966f9cc4696d4612984)
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/55cdf0f9
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/55cdf0f9
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/55cdf0f9
Branch: refs/heads/1.6.x
Commit: 55cdf0f9885d6b40fcce670554023f17bb4ee2f3
Parents: 9bb3883
Author: Jie Yu <yu...@gmail.com>
Authored: Mon Jun 25 22:35:34 2018 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Jun 26 09:08:30 2018 -0700
----------------------------------------------------------------------
src/tests/containerizer/cni_isolator_tests.cpp | 41 +++++++++++++++++++++
1 file changed, 41 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/55cdf0f9/src/tests/containerizer/cni_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/cni_isolator_tests.cpp b/src/tests/containerizer/cni_isolator_tests.cpp
index b58a9ca..b282e10 100644
--- a/src/tests/containerizer/cni_isolator_tests.cpp
+++ b/src/tests/containerizer/cni_isolator_tests.cpp
@@ -505,6 +505,33 @@ TEST_F(CniIsolatorTest, ROOT_FailedPlugin)
// kill the task and then verify we can receive TASK_KILLED for the task.
TEST_F(CniIsolatorTest, ROOT_SlaveRecovery)
{
+ // This file will be touched when CNI delete is called.
+ const string cniDeleteSignalFile = path::join(sandbox.get(), "delete");
+
+ Try<net::IP::Network> hostNetwork = getNonLoopbackIP();
+ ASSERT_SOME(hostNetwork);
+
+ Try<string> mockPlugin = strings::format(
+ R"~(
+ #!/bin/sh
+ if [ x$CNI_COMMAND = xADD ]; then
+ echo '{'
+ echo ' "ip4": {'
+ echo ' "ip": "%s/%d"'
+ echo ' }'
+ echo '}'
+ else
+ touch %s
+ fi
+ )~",
+ hostNetwork->address(),
+ hostNetwork->prefix(),
+ cniDeleteSignalFile);
+
+ ASSERT_SOME(mockPlugin);
+
+ ASSERT_SOME(setupMockPlugin(mockPlugin.get()));
+
Try<Owned<cluster::Master>> master = StartMaster();
ASSERT_SOME(master);
@@ -591,10 +618,24 @@ TEST_F(CniIsolatorTest, ROOT_SlaveRecovery)
// Stop the slave after TASK_RUNNING is received.
slave.get()->terminate();
+ Future<ReregisterExecutorMessage> reregisterExecutorMessage =
+ FUTURE_PROTOBUF(ReregisterExecutorMessage(), _, _);
+
// Restart the slave.
slave = StartSlave(detector.get(), flags);
ASSERT_SOME(slave);
+ AWAIT_READY(reregisterExecutorMessage);
+
+ Clock::pause();
+ Clock::advance(flags.executor_reregistration_timeout);
+ Clock::settle();
+ Clock::resume();
+
+ // NOTE: CNI DEL command should not be called. This is used to
+ // capture the regression described in MESOS-9025.
+ ASSERT_FALSE(os::exists(cniDeleteSignalFile));
+
// Kill the task.
driver.killTask(task.task_id());
[3/3] mesos git commit: Added MESOS-9025 to the 1.6.1 CHANGELOG.
Posted by ji...@apache.org.
Added MESOS-9025 to the 1.6.1 CHANGELOG.
(cherry picked from commit abfd6eecb3dce43444084e09d226602ab28f96e2)
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/638ba975
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/638ba975
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/638ba975
Branch: refs/heads/1.6.x
Commit: 638ba9759da93bca05d58bebe7a5a7951d29eca5
Parents: 55cdf0f
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Jun 26 09:08:04 2018 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Jun 26 09:10:36 2018 -0700
----------------------------------------------------------------------
CHANGELOG | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/638ba975/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index e6ca895..b7ba9f5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -13,6 +13,7 @@ Release Notes - Mesos - Version 1.6.1 (WIP)
* [MESOS-8963] - Executor crash trying to print container ID.
* [MESOS-8980] - mesos-slave can deadlock with docker pull.
* [MESOS-9002] - GCC 8.1 build failure in os::Fork::Tree.
+ * [MESOS-9025] - The container which joins CNI network and has checkpoint enabled will be mistakenly destroyed by agent.
Release Notes - Mesos - Version 1.6.0
[2/3] mesos git commit: Fixed orphan container cleanup issue in CNI
isolator.
Posted by ji...@apache.org.
Fixed orphan container cleanup issue in CNI isolator.
The bug was introduced in https://reviews.apache.org/r/65987/ when we
want to allow nested container to have a separate network namespace than
its parent (MESOS-8534).
The original code misses a `continue` statement after recovering regular
containers.
I am surprised that the unit tests didn't catch the bug. We'll add a new
unit test for catching the regression.
Review: https://reviews.apache.org/r/67728
(cherry picked from commit 230b8689b380043c30d1db18af8f7a9380f4ceeb)
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9bb38835
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9bb38835
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9bb38835
Branch: refs/heads/1.6.x
Commit: 9bb38835fe381afa678576e3a05eb735763cdf59
Parents: a343aca
Author: Jie Yu <yu...@gmail.com>
Authored: Mon Jun 25 11:48:07 2018 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Jun 26 09:08:30 2018 -0700
----------------------------------------------------------------------
.../mesos/isolators/network/cni/cni.cpp | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/9bb38835/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp b/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp
index 6905cd6..c4b549f 100644
--- a/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp
+++ b/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp
@@ -426,17 +426,15 @@ Future<Nothing> NetworkCniIsolatorProcess::recover(
"Failed to recover CNI network information for orphaned the "
"container " + stringify(containerId) + ": " + recover.error());
}
- }
-
- // Known orphan containers will be cleaned up by containerizer
- // using the normal cleanup path. See MESOS-2367 for details.
- if (orphans.contains(containerId)) {
- continue;
- }
- LOG(INFO) << "Removing unknown orphaned container " << containerId;
+ // Known orphan containers will be cleaned up by containerizer
+ // using the normal cleanup path. See MESOS-2367 for details.
+ if (!orphans.contains(containerId)) {
+ LOG(INFO) << "Removing unknown orphaned container " << containerId;
- cleanup(containerId);
+ cleanup(containerId);
+ }
+ }
}
return Nothing();