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 CE31E6EC56; Fri, 19 Mar 2021 01:34:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CE31E6EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616106878; bh=eRkPoHzBTsUF02znMvv1YRCh3U4zPio+cYxvzXyOU3M=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=CQUcRIBa7tg4Yf8gIuEhPExzdCO188DWLVNCC0NS+o5MEob2mz6P2y3wztAlw2hYB II2lz5kTxBYbvuj8V0RySdwuExDtymfQoYFx1tl6M7opPyVMA/tWh/5kJzLwpVHcOJ cQR79yeO+OUfgSV0nF5Iqfc68/5Oil9HRvsQ554o= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 67DF86EC56 for ; Fri, 19 Mar 2021 01:34:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 67DF86EC56 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lN1Dw-0002Fa-K9; Fri, 19 Mar 2021 01:34:37 +0300 To: Cyrill Gorcunov References: Message-ID: Date: Thu, 18 Mar 2021 23:34:35 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD96485A7A9FC13189318D1C1B1AED51F3A523B142B0B75A42F182A05F538085040E78EAAC67384085DB40D9FF9181C388AF789A7C5FD9E15624F0E44449330F386 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73B44982FA5E78411EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063748E7A03516F25E8E8638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C81A23F326053F8271295F953AF4B0430BBC15B0011EBB12DA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7850F8B975A76562C9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C351672B98BD86E645117882F4460429728AD0CFFFB425014E868A13BD56FB6657A7F4EDE966BC389F9E8FC8737B5C22499DC5D3EDC80DC730089D37D7C0E48F6CCF19DD082D7633A0E7DDDDC251EA7DABAAAE862A0553A39223F8577A6DFFEA7C3FDC8C18C1E1F95E43847C11F186F3C5E7DDDDC251EA7DABCC89B49CDF41148F6B16E133A9586FB82623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2BBE337FB72E923155C0AF1600DCBC20BD52826C51A2876ABA1A249A85503F65D X-C1DE0DAB: 0D63561A33F958A58A85CD0B52C04D3B4A672BA134FA85ACBE8D5D8B20F7DCC9D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D346BEB6F73FB9D1E4AC99AEEC31AADB1E5A920AE42017C32C98EB7004D212A272B5AC36F258D31454F1D7E09C32AA3244C3777B6A06B5C7635BBFCB59B26BFC6D65595C85A795C7BAEFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyKyJYJ15DtIM54duwwaQPg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A06382276B2C884AE7DEA6354015B01938BFC6B3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/2] swim: add SO_BROADCAST option 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" >>>> diff --git a/src/lib/swim/swim_io.c b/src/lib/swim/swim_io.c >>>> index c8558c43e..45df36ba4 100644 >>>> --- a/src/lib/swim/swim_io.c >>>> +++ b/src/lib/swim/swim_io.c >>>> @@ -512,8 +512,23 @@ static inline void >>>> swim_complete_send(struct swim_scheduler *scheduler, struct swim_task *task, >>>> ssize_t size) >>>> { >>>> - if (size < 0) >>>> - diag_log(); >>>> + if (size < 0) { >>>> + bool is_critical = false; >>>> +#if TARGET_OS_DARWIN >>>> + /* >>>> + * On Mac this error happens regularly if SWIM is bound to >>>> + * the localhost and tries to broadcast out of the machine. This >>>> + * is not critical, because will happen in the tests a lot, and >>>> + * in prod it simply should not bind to localhost if there are >>>> + * multiple machines in the cluster. Besides, Mac as a platform >>>> + * is not supposed to be used in prod. >>>> + */ >>>> + struct error *last = diag_last_error(diag_get()); >>>> + is_critical = (last->saved_errno == EADDRNOTAVAIL); >>>> +#endif >>>> + if (is_critical) >>>> + diag_log(); >>>> + } >>>> if (task->complete != NULL) >>>> task->complete(task, scheduler, size); >>> >>> Vlad, I don't understand. For non-mac users this @is_critical will >>> always be false, maybe we better move the whoe branch to TARGET_OS_DARWIN >>> then? Ie >>> >>> if (size < 0) { >>> #if TARGET_OS_DARWIN >>> if (is_critical) >>> diag_log(); >>> #endif >>> } >>> >>> or you made it this way to escape unused parameter compiler warning? >> >> I added the variable on all platforms on purpose. Because if the code would >> be done the way you propose above, non-Mac platforms won't log anything. > > The do not log anything with the patch. Lets drop TARGET_OS_DARWIN path > from your patch and we will have > > swim_complete_send(struct swim_scheduler *scheduler, struct swim_task *task, > ssize_t size) > { > if (size < 0) { > bool is_critical = false; > if (is_critical) > diag_log(); > } > } > > The is_critical is always false, or there is a typo in the code above. Oh shit, indeed :)