> On June 26, 2014, 2:32 p.m., Chi Zhang wrote:
> > 5 byte prefix is fine, but could potentially break. See the email
> > discussion from some time ago: (if only mesos had a 4 character name:)
> >
> > -------------------
> > ::recover(id, pid):
> > A design decision here is to use pid to compose the name of the host
> > side interface of the veth pair: eth{pid}. (Could this be too long for
> > a eth device name?)
> >
> > You have 15 bytes for the name. A pid can is a 32 bit number so can use 11
> > of
> > those bytes. So there are 4 bytes for a prefix.
> >
> > so eth{pid} will work but I don't think we want to use eth as a prefix.
> > Some other
> > 3 or 4 letter prefix that does not suggest a physical ethernet interface is
> > likely better.
> >
> > what about veth?
> >
> > I like veth ;-)
> >
> > pid_t is int but actual pids are only 0-65536 aren't they? so 5 characters
> > is sufficient.
> >
> > It depends in practice on /proc/sys/kernel/pid_max. The current
> > implementation maximum is 2^22 aka 4194304 but I hate to bake that limit
> > into anything. Better to assume that the whole 32 bit range might be
> > used.
> >
Concern was that veth is commonly used by non-Mesos applications and we would
blindly remove them as orphans during recovery.
pid_t is a signed 32 bit integer on Linux but actually limited to 2^22 on
64-bit systems, see proc(5), which means it takes at most 7 characters for the
pid: 7 + strlen(VETH_PREFIX) < 15, which is true for VETH_PREFIX=mesos.
/proc/sys/kernel/pid_max (since Linux 2.5.34)
This file specifies the value at which PIDs wrap around (i.e.,
the value in this file is one greater than the maximum PID). The
default value for this file, 32768, results in the same range of
PIDs as on earlier kernels. On 32-bit platforms, 32768 is the
maximum value for pid_max. On 64-bit systems, pid_max can be set
to any value up to 2^22 (PID_MAX_LIMIT, approximately 4
million).
- Ian
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23089/#review46802
-----------------------------------------------------------
On June 26, 2014, 2:10 p.m., Jie Yu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/23089/
> -----------------------------------------------------------
>
> (Updated June 26, 2014, 2:10 p.m.)
>
>
> Review request for mesos and Vinod Kone.
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> See summary.
>
>
> Diffs
> -----
>
> src/slave/containerizer/isolators/network/port_mapping.hpp 9ef28bc
> src/slave/containerizer/isolators/network/port_mapping.cpp 6f8dd17
> src/tests/isolator_tests.cpp a07142c
>
> Diff: https://reviews.apache.org/r/23089/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Jie Yu
>
>