You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by qi...@apache.org on 2020/05/29 08:40:15 UTC

[mesos] branch 1.8.x updated (bb32bf8 -> f8b8f1e)

This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a change to branch 1.8.x
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from bb32bf8  Added test for fetch from repositories not providing scope/service.
     new cdd3e29  Erased `Info` struct before unmouting volumes in Docker volume isolator.
     new f8b8f1e  Added MESOS-10126 to the 1.8.2 CHANGELOG.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGELOG                                                    |  1 +
 .../containerizer/mesos/isolators/docker/volume/isolator.cpp | 12 +++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)


[mesos] 02/02: Added MESOS-10126 to the 1.8.2 CHANGELOG.

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a commit to branch 1.8.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit f8b8f1e9c0fbf0a3ee769eebcebf0b4e98e0bfa6
Author: Qian Zhang <zh...@gmail.com>
AuthorDate: Fri May 29 16:38:04 2020 +0800

    Added MESOS-10126 to the 1.8.2 CHANGELOG.
---
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG b/CHANGELOG
index 6c5bfd3..537e552 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -14,6 +14,7 @@ Release Notes - Mesos - Version 1.8.2 (WIP)
   * [MESOS-9968] - WWWAuthenticate header parsing fails when commas are in (quoted) realm
   * [MESOS-10007] - Command executor can miss exit status for short-lived commands due to double-reaping.
   * [MESOS-10015] - updateAllocation() can stall the allocator with a huge number of reservations on an agent.
+  * [MESOS-10126] - Docker volume isolator needs to clean up the `info` struct regardless the result of unmount operation
 
 ** Improvement
   * [MESOS-9889] - Master CPU high due to unexpected foreachkey behaviour in Master::__reregisterSlave.


[mesos] 01/02: Erased `Info` struct before unmouting volumes in Docker volume isolator.

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a commit to branch 1.8.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit cdd3e2924596eecf605eeb73e9c57f23f6643936
Author: Qian Zhang <zh...@gmail.com>
AuthorDate: Fri May 15 10:23:51 2020 +0800

    Erased `Info` struct before unmouting volumes in Docker volume isolator.
    
    Currently when `DockerVolumeIsolatorProcess::cleanup()` is called, we will
    unmount the volume first, and if the unmount operation fails we will NOT
    erase the container's `Info` struct from `infos`. This is problematic
    because the remaining `Info` in `infos` will cause the reference count of
    the volume is greater than 0, but actually the volume is not being used by
    any containers. That means we may never get a chance to unmount this volume
    on this agent, furthermore if it is an EBS volume, it cannot be used by any
    tasks launched on any other agents since a EBS volume can only be attached
    to one node at a time. The only workaround would manually unmount the volume.
    
    So in this patch `DockerVolumeIsolatorProcess::cleanup()` is updated to erase
    container's `Info` struct before unmounting volumes.
    
    Review: https://reviews.apache.org/r/72516
---
 .../containerizer/mesos/isolators/docker/volume/isolator.cpp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/slave/containerizer/mesos/isolators/docker/volume/isolator.cpp b/src/slave/containerizer/mesos/isolators/docker/volume/isolator.cpp
index 40119d9..c0c689d 100644
--- a/src/slave/containerizer/mesos/isolators/docker/volume/isolator.cpp
+++ b/src/slave/containerizer/mesos/isolators/docker/volume/isolator.cpp
@@ -641,6 +641,13 @@ Future<Nothing> DockerVolumeIsolatorProcess::cleanup(
     futures.push_back(this->unmount(volume.driver(), volume.name()));
   }
 
+  // Erase the `Info` struct of this container before unmounting the volumes.
+  // This is to ensure the reference count of the volume will not be wrongly
+  // increased if unmounting volumes fail, otherwise next time when another
+  // container using the same volume is destroyed, we would NOT unmount the
+  // volume since its reference count would be larger than 1.
+  infos.erase(containerId);
+
   return await(futures)
     .then(defer(
         PID<DockerVolumeIsolatorProcess>(this),
@@ -654,8 +661,6 @@ Future<Nothing> DockerVolumeIsolatorProcess::_cleanup(
     const ContainerID& containerId,
     const vector<Future<Nothing>>& futures)
 {
-  CHECK(infos.contains(containerId));
-
   vector<string> messages;
   foreach (const Future<Nothing>& future, futures) {
     if (!future.isReady()) {
@@ -680,9 +685,6 @@ Future<Nothing> DockerVolumeIsolatorProcess::_cleanup(
   LOG(INFO) << "Removed the checkpoint directory at '" << containerDir
             << "' for container " << containerId;
 
-  // Remove all this container's docker volume information from infos.
-  infos.erase(containerId);
-
   return Nothing();
 }