From reviews-return-66159-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Wed Sep 20 14:24:50 2017 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 211D61070D for ; Wed, 20 Sep 2017 14:24:50 +0000 (UTC) Received: (qmail 17749 invoked by uid 500); 20 Sep 2017 14:24:50 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 17718 invoked by uid 500); 20 Sep 2017 14:24:50 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 17691 invoked by uid 99); 20 Sep 2017 14:24:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Sep 2017 14:24:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4BAE4184C73; Wed, 20 Sep 2017 14:24:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.249 X-Spam-Level: *** X-Spam-Status: No, score=3.249 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id J78uPXo7XGpC; Wed, 20 Sep 2017 14:24:47 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 0D1935F297; Wed, 20 Sep 2017 14:24:47 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 55DF6E00A3; Wed, 20 Sep 2017 14:24:46 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id 41527C401D5; Wed, 20 Sep 2017 14:24:46 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============2092959307998738059==" MIME-Version: 1.0 Subject: Re: Review Request 61183: Triggered 'UpdateSlaveMessage' when 'ResourceProviderManager' updates. From: Benjamin Bannier To: Jie Yu , Jan Schlicht Cc: Benjamin Bannier , Mesos Reviewbot Windows , mesos Date: Wed, 20 Sep 2017 14:24:46 -0000 Message-ID: <20170920142446.1947.42250@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Benjamin Bannier X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/61183/ X-Sender: Benjamin Bannier References: <20170918220345.55959.30945@reviews-vm2.apache.org> In-Reply-To: <20170918220345.55959.30945@reviews-vm2.apache.org> Reply-To: Benjamin Bannier X-ReviewRequest-Repository: mesos --===============2092959307998738059== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Sept. 19, 2017, 12:03 a.m., Jie Yu wrote: > > src/slave/slave.cpp > > Lines 6669 (patched) > > > > > > add a `break` for the first level switch? and a default? I added a `break` here. I did not add a `default` branch as we want to explicitly trigger a compiler warning about uncovered cases here should another message type be added in the future. > On Sept. 19, 2017, 12:03 a.m., Jie Yu wrote: > > src/tests/slave_tests.cpp > > Lines 8357 (patched) > > > > > > can we get rid of the process:: prefix? All types from `process::http` in this file are fully qualified (e.g., also `process::http::Request`). I'll submit an additional RR to tidy this up (https://reviews.apache.org/r/62439/). > On Sept. 19, 2017, 12:03 a.m., Jie Yu wrote: > > src/tests/slave_tests.cpp > > Lines 8372 (patched) > > > > > > Do we need the `mesos::` prefix? I believe sadly we do. We for sure what to distinguish unversioned from e.g., `v1` types. On the other hand in tests we have a namespace `mesos::internal::v1` and just e.g., `v1::resource_provider::Event::Subscribed` is looked up in that one instead of `mesos::v1`. I guess an alternative would be to define aliases for `v1` types and subnamespaces, but I don't see that being done currently (and it IMO seems to make things even more convoluted). - Benjamin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61183/#review185583 ----------------------------------------------------------- On Sept. 20, 2017, 4:24 p.m., Benjamin Bannier wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61183/ > ----------------------------------------------------------- > > (Updated Sept. 20, 2017, 4:24 p.m.) > > > Review request for mesos, Jie Yu and Jan Schlicht. > > > Repository: mesos > > > Description > ------- > > The agent's resource provider manager sends a > 'ResourceProviderMessage' when its managed resources change. This > commit adds handling in the agent so that an 'UpdateSlaveMessage' is > sent to the master to update the total resource available on the > agent. > > In order to provide push-like handling of the resource provider > manager's message queue, we chain recursive calls to the handler for > continuous processing. Initially, processing is kicked off from > 'Slave::initialize'. In this simple implementation we e.g., provide no > direct way to stop processing of messages, yet, but it can be achieved > by e.g., replacing the manager with a new instance (this would also > require updating routes). > > Since the agent can only send an 'UpdateSlaveMessage' when it is > registered with a master, a simple back-off of 5 s is implemented which > will defer processing of a ready message should the agent not yet have > registered. > > To facilitate logging we add a stringification function for > 'ResourceProviderMessage's. > > This patch also adjusts a number of tests to no expect two > 'UpdateSlaveMessage's. > > > Diffs > ----- > > src/resource_provider/message.hpp 3c7c3f2baeb726e04edd6ffbb9784699d7afe521 > src/slave/slave.hpp aea1e948209c7c8945665915bc2f6d8eb47814ef > src/slave/slave.cpp 01020a624bdd67ee6371f607d897ad71a2cdcc82 > src/tests/oversubscription_tests.cpp 02b10d6689dd6f01510cd2d5db2bb76b4b190eca > src/tests/slave_tests.cpp e9bcfefd52e1e99a7a5877b2e7c30af958ca1723 > > > Diff: https://reviews.apache.org/r/61183/diff/10/ > > > Testing > ------- > > Tested on a number of platforms on internal CI. > > > Thanks, > > Benjamin Bannier > > --===============2092959307998738059==--