You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Benno Evers (JIRA)" <ji...@apache.org> on 2018/11/22 19:38:00 UTC

[jira] [Created] (MESOS-9413) Composing containerizer has no way to wait for container removal

Benno Evers created MESOS-9413:
----------------------------------

             Summary: Composing containerizer has no way to wait for container removal
                 Key: MESOS-9413
                 URL: https://issues.apache.org/jira/browse/MESOS-9413
             Project: Mesos
          Issue Type: Bug
            Reporter: Benno Evers


Inside the composing containerizer, destruction is ultimately implemented like this:
{noformat}
  return container->containerizer->destroy(containerId)
    .onAny(defer(self(), [=](const Future<Option<ContainerTermination>>&) {
      if (containers_.contains(containerId)) {
        delete containers_.at(containerId);
        containers_.erase(containerId);
      }
    }));
{noformat}

This means that code trying to ensure that every container is killed like this
{noformat}
    foreach (const ContainerID& containerId, containers.get()) {
      process::Future<Option<ContainerTermination>> termination =
        containerizer->destroy(containerId);

      AWAIT(termination);
  }
  ASSERT_TRUE(containerizer->empty());
{noformat}

is inherently racy, because the call to `empty()` might happen before the removal that gets deferred in the `.onAny()`-callback is executed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)