mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <benjamin.bann...@mesosphere.io>
Subject Review Request 64650: Made resource provider driver start explicit.
Date Fri, 15 Dec 2017 13:29:52 GMT

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

Review request for mesos, Chun-Hung Hsiao, Jie Yu, and Jan Schlicht.


Repository: mesos


Description
-------

The driver for HTTP connections of resource providers is implemented
as an actor which takes callbacks. It previously started listening for
and handling of events on creation. We typically store drivers as
member of resource providers.

This setup is in general problematic since it e.g., becomes impossible
to write safe callbacks using internal resource provider state; it was
e.g., impossible to write a safe callback using the member driver to
send calls. This is due to a race between initialization of the member
driver and a newly created driver starting to handle events and
triggering callbacks making use of a not yet initialized member driver
variable. As a concrete example, with a 'MockResourceProvider' holding
a 'std::unique_ptr<Driver>' member tests would regularly hit this
race, even though the time window between creating a temporary to
assign to the member and the assignment appeared to be small.

This patch introduces an explicit 'start' method to the driver which
is to be used to explicitly start processing of events by the driver.


Diffs
-----

  include/mesos/v1/resource_provider.hpp 006889a090d5d211cf8e03d67c849753639207f3 
  src/resource_provider/driver.cpp 62c4ca11e40fae7c2da929511ce304908e4e9256 
  src/resource_provider/http_connection.hpp 207120a6d28d231276b34ce30e6ae2f640884e19 
  src/resource_provider/storage/provider.cpp 17acf1b430b81e31bd97b117a44477eebab7e6f4 
  src/tests/mesos.hpp 6207d621f0496c69f34280da2246d7d9967ba55b 


Diff: https://reviews.apache.org/r/64650/diff/1/


Testing
-------

`make check`

Without this patch `ContentType/ResourceProviderManagerHttpApiTest.ConvertResources/0` fails
after < 30 iterations; with this patch it passes > 2000 iterations.


Thanks,

Benjamin Bannier


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