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 12:41:51 GMT

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

(Updated July 4, 2016, 2:41 p.m.)


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


Changes
-------

Pass `Flags` by raw ptr.


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


Repository: mesos


Description (updated)
-------

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/slave/container_loggers/lib_logrotate.cpp d53847bbca83367927725f06e8f962ce7011f468 
  src/slave/containerizer/docker.cpp f1ecf3b25d85597f6c3dcaa47968860ed119dbd5 
  src/slave/containerizer/mesos/containerizer.cpp a523799b3bd8a69c3dcd5a47ed9d81eace906686

  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 25d2a57d7a814d735db78bda8c6956199de5c390

  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 7b4d47bd9e99b71269093d7c11559f3b74a3e22b 
  src/tests/containerizer/launch_tests.cpp 3e36f2f7ab89b98de2c1a971e4ecca58c13ad642 
  src/tests/containerizer/launcher.hpp 49f8ecb47abb098bf76017f79b7d00380401efe4 
  src/tests/containerizer/mesos_containerizer_tests.cpp 7ffec9ec9788d0e15c2c0ccc7d10b8b64ad40057

  src/tests/containerizer/port_mapping_tests.cpp 1c50cf545392488cf1e2d51d8e03887bebef5e75


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