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 CC6137030F; Thu, 25 Feb 2021 15:42:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CC6137030F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614256936; bh=fLdkyeHkEQVZ/HY8Wcr3Q1fFn/h6B2bdHHbQ51siprM=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gNmj/5oEBoF9/vNbFakVgAVto65eB/k1108eSB+uksOrfQ8lvVivVoR2nfV28Hx6O tRqT7KD6N4ttcyVYcm08FtYjxvOsMyyogPAj896IUX277Z72iTsTDxU7Px+llYLU7F iHU8qLV7IPN8cHAAbnSyCbAtyyTPyCejF08qPU7w= Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (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 2579C7030F for ; Thu, 25 Feb 2021 15:42:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2579C7030F Received: by smtp47.i.mail.ru with esmtpa (envelope-from ) id 1lFFy9-0003pO-UB; Thu, 25 Feb 2021 15:42:14 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, yaroslav.dynnikov@tarantool.org References: <627b3c57-d8a9-5681-fb4d-38d0053c6aa7@tarantool.org> <0810bac1-dfaf-6db5-fdf0-65e26f243e1e@tarantool.org> Message-ID: Date: Thu, 25 Feb 2021 15:42:13 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <0810bac1-dfaf-6db5-fdf0-65e26f243e1e@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD975C3EC174F56692243410BA6471F01668A37AB103014B813182A05F53808504006B820AF5AD46F3F6745CB25302D5FE4B96074FB246B674B8E7F66FB5276EC88 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A1DB0B089319D380EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063770995E888C5C26978638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95CDDE882590F889B1C188BFF6BFEF286426BA7AD202651A5B9A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE70F3DDF2BBF19B93A9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C34C82C86BFC697D19117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF8A2765277F08B644BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6B880EA3D0D04DCFA76E601842F6C81A1F004C90652538430CDED94BCBF13EF3B93EC92FD9297F6718AA50765F790063723B0D190C46BCD7DA7F4EDE966BC389F395957E7521B51C24C7702A67D5C33162DBA43225CD8A89FDD9D78FC3670308535872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C9DE2850DD75B2526BE5BFE6E7EFDEDCD789D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24A6D60772A99906F8E1CD14B953EB46D1F464A7462ADFDB3355D89D7DBCDD132 X-C1DE0DAB: 0D63561A33F958A535813413D57BA9123E6A3B445C1B51C90BCBF3A2E604D831D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7557E988E9157162368E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C2E47CA9A5606090B6AA5B2A0311EA7EFE4F55C99F1E04AC14FFBDB783DA736E3ED5CA74CC02FDB91D7E09C32AA3244C17E16769D2B442EA3B58C1CCCA8FF870795D98D676DD64D0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojvz1c9SWJtj94SbAgpaHshA== X-Mailru-Sender: 583F1D7ACE8F49BD9317CE1922F30C7E1A95D92408FB25E39E6F6A8EE36224C78AA44A9D95F5E73323E75C7104EB1B885DEE61814008E47C7013064206BFB89F93956FB04BA385BE9437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH vshard 01/11] error: introduce vshard.error.timeout() 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: Oleg Babin via Tarantool-patches Reply-To: Oleg Babin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for your answers, consider my comments below. On 25.02.2021 00:46, Vladislav Shpilevoy wrote: > Hi! Thanks for the review! > > On 24.02.2021 11:27, Oleg Babin wrote: >> Hi! Thanks for your patch. >> >> Personally, I vote for dropping 1.9 support (it's already broken - #256). > It kind of works. Just with some spam in the logs. But yeah, I would like > to finally drop it. I talked to Mons and he approved this: > https://github.com/tarantool/vshard/issues/267 Good news! >> But if you want to eliminate "long and ugly" ways you could do something like: >> >> >> ``` >> >> local make_timeout >> if box.error.new ~= nil then >>     make_timeout = function() return box.error.new(box.error.TIMEOUT) end >> else >>     make_timeout = function() return select(2, pcall(...)) end >> end >> >> ``` > Which is longer and uglier, right? Where is the win? Not sure it's important for errors but pcall is a bit slower. ``` local clock = require('clock') local start = clock.time() for _ = 1,1e5 do     pcall(box.error, box.error.TIMEOUT) end print(clock.time() - start) local start = clock.time() for _ = 1,1e5 do     box.error.new(box.error.TIMEOUT) end print(clock.time() - start) ``` 0.22471904754639 0.12087297439575 (on my Mac) Feel free to ignore. LGTM.