You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Guangya Liu (JIRA)" <ji...@apache.org> on 2016/05/04 08:14:12 UTC

[jira] [Updated] (MESOS-5328) Docker volume isolator will mount volumes randomly if there are multiple volumes for one container

     [ https://issues.apache.org/jira/browse/MESOS-5328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guangya Liu updated MESOS-5328:
-------------------------------
    Description: 
I was writing some test cases and found that sometimes the volume and mount point cannot match well when there are multiple volumes for one container.

{code}
  // Create volume with relative path.
  hashmap<string, string> options;
  const string key = "iops";
  const string value = "150";
  options[key] = value;
  const string driver1 = "driver1";
  const string name1 = "name1";
  const string containerPath1 = "tmp/foo1";
  Volume volume1 = createDockerVolume(
      driver1, name1, containerPath1, options);

  // Create volume with absolute path.
  const string driver2 = "driver2";
  const string name2 = "name2";
  // Make sure the absolute path exsit.
  const string containerPath2 = path::join(os::getcwd(), "foo2");
  ASSERT_SOME(os::mkdir(containerPath2));
  Volume volume2 = createDockerVolume(
      driver2, name2, containerPath2);
{code}

During test, I found that sometimes, the {{foo1}} is mount to {{mountpoint2}} while {{foo2}} mount to {{mountpoint1}}.

  was:
I was writing some test cases and found that sometimes the volume and mount point cannot match well when there are multiple volumes for one container.

{code}
  // Create volume with relative path.
  hashmap<string, string> options;
  const string key = "iops";
  const string value = "150";
  options[key] = value;
  const string driver1 = "driver1";
  const string name1 = "name1";
  const string containerPath1 = "tmp/foo1";
  Volume volume1 = createDockerVolume(
      driver1, name1, containerPath1, options);

  // Create volume with absolute path.
  const string driver2 = "driver2";
  const string name2 = "name2";
  // Make sure the absolute path exsit.
  const string containerPath2 = path::join(os::getcwd(), "foo2");
  ASSERT_SOME(os::mkdir(containerPath2));
  Volume volume2 = createDockerVolume(
      driver2, name2, containerPath2);
{code}

During test, I found that sometimes, the {{foo1}} is mount to {{mountpoint2}} while {{foo2}} mount to {{mountpoint1}}.

The root cause is that the {{volumes}} in prepare are persisted in a {{hashset}} and the {{hashset}} cannot make sure the order.


> Docker volume isolator will mount volumes randomly if there are multiple volumes for one container
> --------------------------------------------------------------------------------------------------
>
>                 Key: MESOS-5328
>                 URL: https://issues.apache.org/jira/browse/MESOS-5328
>             Project: Mesos
>          Issue Type: Bug
>            Reporter: Guangya Liu
>            Assignee: Guangya Liu
>
> I was writing some test cases and found that sometimes the volume and mount point cannot match well when there are multiple volumes for one container.
> {code}
>   // Create volume with relative path.
>   hashmap<string, string> options;
>   const string key = "iops";
>   const string value = "150";
>   options[key] = value;
>   const string driver1 = "driver1";
>   const string name1 = "name1";
>   const string containerPath1 = "tmp/foo1";
>   Volume volume1 = createDockerVolume(
>       driver1, name1, containerPath1, options);
>   // Create volume with absolute path.
>   const string driver2 = "driver2";
>   const string name2 = "name2";
>   // Make sure the absolute path exsit.
>   const string containerPath2 = path::join(os::getcwd(), "foo2");
>   ASSERT_SOME(os::mkdir(containerPath2));
>   Volume volume2 = createDockerVolume(
>       driver2, name2, containerPath2);
> {code}
> During test, I found that sometimes, the {{foo1}} is mount to {{mountpoint2}} while {{foo2}} mount to {{mountpoint1}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)