----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/35330/#review88134 -----------------------------------------------------------
High level review, why don't we just have an abstraction for limiting the number of concurrent operations? You could keep this abstraction local to this file for now and consider pulling it out into libprocess. For example, rather than using a 'RateLimiter' here, we use a 'ConcurrencyLimiter': ``` // Limits concurrency of asynchronous operations. class ConcurrencyLimiter { public: ConcurrencyLimit(size_t concurrency); // Adds a unit of asynchronous work to execute. The work may // be postponed to ensure the concurrency limit is not violated. // Returns the result of the work. template <typename T> Future<T> add(const std::function<Future<T>& work); }; ``` Then you only need a fairly clean, minimal change to the existing source to leverage this, and you can use it elsewhere too. Not sure if 'ConcurrencyLimiter' is the clearest name, but hopefully you get the high level idea. - Ben Mahler On June 11, 2015, 9:39 p.m., Lily Chen wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/35330/ > ----------------------------------------------------------- > > (Updated June 11, 2015, 9:39 p.m.) > > > Review request for mesos and Timothy Chen. > > > Bugs: MESOS-2797 > https://issues.apache.org/jira/browse/MESOS-2797 > > > Repository: mesos > > > Description > ------- > > Capped number of parallel inspect instances on a docker ps call. > > > Diffs > ----- > > src/docker/docker.hpp 7790d0ff9a6b085025f595533c5f46b702447927 > src/docker/docker.cpp 71383294c6234d08b2156565b170ada329b8e30f > src/slave/constants.hpp 84927e589499e989249c217db571bbeb84a88af1 > > Diff: https://reviews.apache.org/r/35330/diff/ > > > Testing > ------- > > sudo ./mesos-tests.sh --gtest_filter="*DOCKER*" --gtest_break_on_failure > --gtest_shuffle --gtest_repeat=30 > > > Thanks, > > Lily Chen > >