From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 459252C06E for ; Thu, 11 Apr 2019 08:57:55 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gz4DZIVV-CtK for ; Thu, 11 Apr 2019 08:57:55 -0400 (EDT) Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [94.100.177.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id EF49C2BFBF for ; Thu, 11 Apr 2019 08:57:54 -0400 (EDT) Received: by smtp44.i.mail.ru with esmtpa (envelope-from ) id 1hEZH7-0006H6-AD for tarantool-patches@freelists.org; Thu, 11 Apr 2019 15:57:53 +0300 Date: Thu, 11 Apr 2019 15:57:53 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 1/2] swim: introduce broadcast tasks Message-ID: <20190411125753.GA2123@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org * Vladislav Shpilevoy [19/04/10 21:01]: > When a cluster is just created, no one knows anyone. Broadcast > helps to establish some initial relationships between members. > > This commit introduces only an interface to create broadcast > tasks from SWIM code. The next commit uses this interface to > implement ping broadcast. > +/** > + * Broadcast task. Besides usual task fields, stores a list of > + * interfaces available for broadcast packets. The task works > + * multiple times, each time sending a packet to one interface. > + * After completion it is self-deleted. > + */ > +struct swim_bcast_task { Please explain in the comment why you need a task - you may only broadcast when a socket is writable, so use a generic way to interact with the transport. Please mention why you create a single task, not multiple - no particular reason, just to create fewer tasks and do less error checking for failed resources. Please mention in a comment to swim_broadcast that we send a broadcast message to all interfaces which are support IP protocol and broadcast messages. Otherwise the patch is OK to push. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov