mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jie Yu <yujie....@gmail.com>
Subject Re: Review Request 45690: Ensured the bind mount root is a shared mount in its own peer group.
Date Tue, 05 Apr 2016 17:25:22 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45690/
-----------------------------------------------------------

(Updated April 5, 2016, 5:25 p.m.)


Review request for mesos, Ian Downes and Cong Wang.


Bugs: MESOS-4662
    https://issues.apache.org/jira/browse/MESOS-4662


Repository: mesos


Description (updated)
-------

This is for the port mapping isolator.

This is a simple test I did on a fresh Fedora23 box:
```
Jies-MacBook-Pro:fedora23 jie$ vagrant ssh
Last login: Mon Apr  4 17:27:28 2016 from 10.0.2.2
[vagrant@localhost ~]$ sudo mkdir /var/run/netns
[vagrant@localhost ~]$ cat /proc/self/mountinfo
...
23 58 0:20 / /run rw,nosuid,nodev shared:22 - tmpfs tmpfs rw,seclabel,mode=755
...
[vagrant@localhost ~]$ sudo mount --bind /var/run/netns /var/run/netns
[vagrant@localhost ~]$ cat /proc/self/mountinfo
...
23 58 0:20 / /run rw,nosuid,nodev shared:22 - tmpfs tmpfs rw,seclabel,mode=755
72 23 0:20 /netns /run/netns rw,nosuid,nodev shared:22 - tmpfs tmpfs rw,seclabel,mode=755
...
[vagrant@localhost ~]$ sudo touch /var/run/netns/$$ && sudo mount --bind /proc/self/ns/net
/var/run/netns/$$
[vagrant@localhost ~]$ cat /proc/self/mountinfo
...
23 58 0:20 / /run rw,nosuid,nodev shared:22 - tmpfs tmpfs rw,seclabel,mode=755
72 23 0:20 /netns /run/netns rw,nosuid,nodev shared:22 - tmpfs tmpfs rw,seclabel,mode=755
74 72 0:3 / /run/netns/1526 rw shared:28 - nsfs nsfs rw
75 23 0:3 / /run/netns/1526 rw shared:28 - nsfs nsfs rw
```

As you can see above, a single bind mount creates two entries in the mount table (`/run/netns/1526`).
This is because /run/netns is in the same peer group as /run. So a single mount operation
under /run/netns will be propergated to /run as well, creating two mounts. This will confuse
the recovery logic in the port mapping isolator.


Diffs
-----

  src/slave/containerizer/mesos/isolators/network/port_mapping.cpp 323c84a3d960a196d8ba87f753814e9d43a07957


Diff: https://reviews.apache.org/r/45690/diff/


Testing
-------

sudo make check on Fedora 23


Thanks,

Jie Yu


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message