mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <benjamin.bann...@mesosphere.io>
Subject Re: Review Request 46822: Avoided slicing of flags in subprocess.
Date Mon, 04 Jul 2016 23:13:57 GMT

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

(Updated July 5, 2016, 1:13 a.m.)


Review request for mesos, Alexander Rukletsov, Joris Van Remoortere, Michael Park, and Vinod
Kone.


Changes
-------

Fixed misses Linux flags uses.


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


Repository: mesos


Description
-------

While `FlagsBase` internally stores just maps of names and
flags, the functions stored in a `Flag` rely on the original type of
the `Flags` containing them (e.g., we perform dynamic casts to detect
their types).

Since `Option<T>` stores `T` as a value (i.e., it cannot contain
reference types) any interface taking an `Option<T>` cannot rely on
polymorphic behavior of `T`. To make use of polymorphism we should
instead store e.g., a pointer type to avoid slicing.

Here we change `Flags` arguments of `subprocess` to allow preserving
the original type so `Flag` functions can work reliably; we do this by
passing a non-owning pointer to a `Flags` so we do not restrict copying.


Diffs (updated)
-----

  src/docker/docker.cpp aad5380f5848f1b49d5524032f3b5b18c2aa1c56 
  src/health-check/health_checker.hpp f61e80d8e5eb09f8f71e80b6600f7c5b1548bd62 
  src/linux/perf.cpp ea823b32edaa82a71cbfac9932aae543c0d7bef4 
  src/slave/container_loggers/lib_logrotate.cpp d53847bbca83367927725f06e8f962ce7011f468 
  src/slave/containerizer/docker.cpp f1ecf3b25d85597f6c3dcaa47968860ed119dbd5 
  src/slave/containerizer/mesos/containerizer.cpp f53b01b0eef8dd24db28d9dbd86bcbd40dc8d17f

  src/slave/containerizer/mesos/isolators/docker/volume/driver.cpp 842f2b5d4037e076cac4fd9c2eeb8f69786cffa7

  src/slave/containerizer/mesos/isolators/network/cni/cni.cpp 92b33111799cb4e1c8bc2051381e1254d701d95c

  src/slave/containerizer/mesos/isolators/network/port_mapping.cpp 79ee960aa70f8bd39f9bf639cc54f6395ff21ad5

  src/slave/containerizer/mesos/isolators/posix/disk.cpp 3dfe7ad4477dd1a6c8585bf761eaf435fd0cb366

  src/slave/containerizer/mesos/launcher.hpp bf435e3a9c150648336a1becf2f075fa183428bd 
  src/slave/containerizer/mesos/launcher.cpp 9efe8474a2210957ce256fc08cb35694194213c3 
  src/slave/containerizer/mesos/linux_launcher.hpp c1852226c74bc611d045be721e284141e59adcd9

  src/slave/containerizer/mesos/linux_launcher.cpp 95dee95c5e6e613e526c92d8729ae5583c8b58f1

  src/tests/containerizer/isolator_tests.cpp 488747347f71a6a1bb6bc01477143d077d4fd3eb 
  src/tests/containerizer/launch_tests.cpp ef0c87c96e6a8379d119246a8ad044248522e67e 
  src/tests/containerizer/launcher.hpp 49f8ecb47abb098bf76017f79b7d00380401efe4 
  src/tests/containerizer/mesos_containerizer_tests.cpp 57588cc1fb918924a163bdb40b195cc5f4231f6e

  src/tests/containerizer/ns_tests.cpp cd668ebb3b9461bee00dc338c288e5df6eb8fe31 
  src/tests/containerizer/port_mapping_tests.cpp 3675c02453160417b24c8b3b0d001208504515a5


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


Testing
-------

Tested on various platforms in internal CI.


Thanks,

Benjamin Bannier


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