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 DD1F16EC43; Mon, 5 Jul 2021 12:24:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DD1F16EC43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1625477060; bh=P4WbucT2bp2tZzins6uSnhi2YJAvvyDz+2Zt1Zjr6wM=; 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=HUhy/wQS/1o19PNAjIzu5CIt5MOvlVlHrUa+VDDzengrTRI2cqiH4VgMlkZCXhG6S P2EV/NORsKA6UzRtNyX5EDCqvkeePk7zYgq5SNwfaVkvArqMSra/wjpE64XaNIKb8O PXfI/Aj++QC9amSegIUcBrB4PFHBrg7jCxke/Gb0= Received: from smtp31.i.mail.ru (smtp31.i.mail.ru [94.100.177.91]) (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 1CF136EC43 for ; Mon, 5 Jul 2021 12:23:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1CF136EC43 Received: by smtp31.i.mail.ru with esmtpa (envelope-from ) id 1m0KpU-0003Ll-EI; Mon, 05 Jul 2021 12:23:52 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, yaroslav.dynnikov@tarantool.org References: <5c8f380f-845d-2373-4148-0c441ba01fab@tarantool.org> Message-ID: <7cdaad8a-139a-f12c-7640-77eab843fabd@tarantool.org> Date: Mon, 5 Jul 2021 12:23:52 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <5c8f380f-845d-2373-4148-0c441ba01fab@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD954DFF1DC42D673FB2F1AA0EB8A504C8721532AB396CDCF09182A05F538085040E87004FE9D007329B0B4940F24E215F2D885362747217F21729364708D586881 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7CF4D16325FBE1EEDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D8F5094E9BAC3E9F8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8620BFCA440847D41AAE0CC53031F5AB4117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FCED03C93EBFE568B33AA81AA40904B5D9CF19DD082D7633A078D18283394535A93AA81AA40904B5D98AA50765F79006377CF2F09735AFCD0ED81D268191BDAD3D698AB9A7B718F8C4D1B931868CE1C5781A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F83C798A30B85E16BCE5475246E174218B5C8C57E37DE458BEDA766A37F9254B7 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C97831B417EAECEF95D73EDABE82F96B12BFBC X-C1DE0DAB: 0D63561A33F958A5AE37D1F7233F43F27961615E7FC31E4EAA0415BF6BDCE5F6D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7569E77FCA7B33833F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34BF5454112BD5BFD70B4DDE28928DE0F77081CD27759F133FC363C2B5F817DFDCB489DC90233BD6FA1D7E09C32AA3244C4E2246863D5CBB9E4920B508C33ECD9681560E2432555DBBFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj5fH2RN9TpJmAZxnqePl4TA== X-Mailru-Sender: 583F1D7ACE8F49BD07526C4546A62CBFC7C307D58D65A815FE1721EDACF096C095E87B70FB6A0BA123E75C7104EB1B885DEE61814008E47C7013064206BFB89F93956FB04BA385BE9437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH vshard 7/6] util: truncate too long fiber name 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 patch! LGTM. On 03.07.2021 00:36, Vladislav Shpilevoy wrote: > Since tarantool's commit 008658b349264538f76327f8d60f2db5451854ea > ("fiber: throw an error on too long fiber name") in version 1.7.6 > fiber:name() fails if the name is too long. But the error can be > suppressed by using {truncate = true} option. > > The patch makes vshard truncate too long names instead of throwing > an error. > --- > test/unit/util.result | 10 ++++++++++ > test/unit/util.test.lua | 5 +++++ > vshard/util.lua | 2 +- > 3 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/test/unit/util.result b/test/unit/util.result > index c83e80c..ec61e8a 100644 > --- a/test/unit/util.result > +++ b/test/unit/util.result > @@ -71,6 +71,16 @@ test_run:grep_log('default', 'reloadable_function has been started', 1000) > fib:cancel() > --- > ... > +-- Re-loadable fiber must truncate too long name. > +name = string.rep('a', 512) > +--- > +... > +fib = util.reloadable_fiber_create(name, fake_M, 'reloadable_function') > +--- > +... > +fib:cancel() > +--- > +... > -- Yielding table minus. > minus_yield = util.table_minus_yield > --- > diff --git a/test/unit/util.test.lua b/test/unit/util.test.lua > index 881feb4..5432c0d 100644 > --- a/test/unit/util.test.lua > +++ b/test/unit/util.test.lua > @@ -28,6 +28,11 @@ while not test_run:grep_log('default', 'module is reloaded, restarting') do fibe > test_run:grep_log('default', 'reloadable_function has been started', 1000) > fib:cancel() > > +-- Re-loadable fiber must truncate too long name. > +name = string.rep('a', 512) > +fib = util.reloadable_fiber_create(name, fake_M, 'reloadable_function') > +fib:cancel() > + > -- Yielding table minus. > minus_yield = util.table_minus_yield > minus_yield({}, {}, 1) > diff --git a/vshard/util.lua b/vshard/util.lua > index 4d2c04e..afa658b 100644 > --- a/vshard/util.lua > +++ b/vshard/util.lua > @@ -90,7 +90,7 @@ local function reloadable_fiber_create(fiber_name, module, func_name, data) > assert(type(fiber_name) == 'string') > local xfiber = fiber.create(reloadable_fiber_main_loop, module, func_name, > data) > - xfiber:name(fiber_name) > + xfiber:name(fiber_name, {truncate = true}) > return xfiber > end >