From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id CE24C6E454; Wed, 2 Mar 2022 01:44:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CE24C6E454 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1646174645; bh=BMRV/871Bp6fd/gUd4ybpY5uqMdUgXcRd2j1QzZvWMQ=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=x2FAa5Pz0nnPfvlM48uR+KCQLub03LquIS1MykXIT+QjJ9JHPrOi8nUjqNOD+e8Ac kwkgQkt+bYdi0pBcMV+4J12ZUKru7qs5HSHoH7MadA1gXMsvNgaDsCrW2EtbN6dl3k HIEcjxPEaihQJJu3wFL9GJKx70S3QHjui4UZ6pU4= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 131D56E454 for ; Wed, 2 Mar 2022 01:44:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 131D56E454 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1nPBDv-0006hI-FL; Wed, 02 Mar 2022 01:44:03 +0300 Message-ID: <493ecf9a-eeb8-a928-d358-947f05a5c32d@tarantool.org> Date: Tue, 1 Mar 2022 23:44:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: Yan Shtunder Cc: tarantool-patches@dev.tarantool.org References: <20220228133255.62874-1-ya.shtunder@gmail.com> In-Reply-To: <20220228133255.62874-1-ya.shtunder@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9C7814344C8C501C848375AF9090CB57CECA83A47433AF06A182A05F5380850400994E44E691DB90A8B0F2282CFFF6F0D1702B80FCAC2131A280E2EAAB6263CD7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE731D82F3F177D3BCDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378A9F193E39E334918638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8AB35BB7C2924AEA65A0AE10A9762869D117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC974A882099E279BDA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18BDFBBEFFF4125B51D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B62CFFCC7B69C47339089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 0D63561A33F958A533ECB71055EA28CC9B8CBBF7F671D954AF7C5C791EE64C90D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F78D6440C3F49C15410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D341ADA1A41A420E9B2D31B0036C841D180C6F76A976967526AEFCBF55CFAD8B73D07BE40EF9955F7031D7E09C32AA3244C290A4B68311BE657DDA7589A15EDDDC224AF4FAF06DA24FD729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojWGWfNw4NKOkH5TuUPiwxdg== X-Mailru-Sender: 689FA8AB762F739339CABD9B3CA9A7D62DDD986F4E7355CB0264A6BA146D79363841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E25FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 net.box] Add predefined system events for pub/sub X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the fixes! In the design document it was also said: The events must be available from the very beginning as not MP_NIL. It will come in handy when local subscriptions will be supported (not via the network). Otherwise no way to detect whether an event is even supported at all by this Tarantool version. By design absence of a subscription key equals MP_NIL and no events are delivered ever except this MP_NIL itself. It happens both if it is not broadcast and if it simply does not exist in the code. And The builtin events should not allow userspace broadcast. Meaning, users should not be able to call box.event.broadcast(‘box.status’, any_data). In the current implementation the built-in events override is still allowed, and before box.cfg{} is called, all the events will return nil. For how to ban built-in events override - in the design doc there is a couple of proposals. A third option would be to check for "box." prefix in the public API of box.broadcast() and return an error if it matches. I would probably ask Vladimir D. for what he thinks is the best among these options. I think he will be the second reviewer anyway. For what to broadcast before box.cfg{} - I have no strong opinion here. Option 1 is to broadcast some invalid default values like `box.schema = {version = 0}`. Option 2 would be to broadcast an empty dictionary. For instance, before box.cfg is called, the following values are available: box.id = {} box.schema = {} box.status = {} box.election = {} This way the users will be able to distinguish an event being not supported at all from box.cfg{} being not called yet. Otherwise they would need to parse _TARANTOOL version string locally and peer_version in netbox. The rest looks good!