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

(Updated May 11, 2016, 2:14 p.m.)


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


Changes
-------

Rebased.


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` function can work reliably. We do this by
passing a `Shared<Flags>` so we do not restrict copying; not that it
would also be possible to use an `Owned<Flags>`, but this would
require an audit of all sites where the arguments are used as
`Owned<T>` should not be copied, but do not prevent that on their own.


Diffs (updated)
-----

  src/slave/container_loggers/lib_logrotate.cpp 
1f228806da32832c9ca1ae4defcd1bdc154adc18 
  src/slave/containerizer/docker.cpp 7af14f4472283ceefd73c06dd8df60af4cf6f7e8 
  src/slave/containerizer/mesos/containerizer.cpp 
75e5a32a3e70ec60a6800e21a621673184ea0956 
  src/slave/containerizer/mesos/isolators/network/cni/cni.cpp 
dae369aadb940150aa806b28d9269e3d88cf57ed 
  src/slave/containerizer/mesos/isolators/network/port_mapping.cpp 
ad792def2bb3a1614d21ca28d858e400d2e3ede1 
  src/slave/containerizer/mesos/launcher.hpp 
5977c30c0aacc569019f7b34bb0c6577823ec887 
  src/slave/containerizer/mesos/launcher.cpp 
a5c8c31b72773d0bd10b9d02675a01f1d641d41c 
  src/slave/containerizer/mesos/linux_launcher.hpp 
89bb2958a41dffe4ade9c2492b9a7412f90a432d 
  src/slave/containerizer/mesos/linux_launcher.cpp 
5028854fa003615f158120e030866b7ec4402b66 
  src/tests/containerizer/launch_tests.cpp 
3e36f2f7ab89b98de2c1a971e4ecca58c13ad642 
  src/tests/containerizer/launcher.hpp c352634c4766d289706c7cc738677619d7d02ccd 
  src/tests/containerizer/port_mapping_tests.cpp 
21ad1e1c53316a3bb6d914aa228ccf3658acdfbf 

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


Testing
-------

Tested on various platforms in internal CI.


Thanks,

Benjamin Bannier

Reply via email to