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 43D696EC40; Sat, 3 Jul 2021 00:36:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 43D696EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1625261813; bh=jVK4LSckF8pG4jROGmQziivn9cqBcpa0i3dtuNM+aOw=; 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=u+l+1oqe/ttBeS0VK22p33/a7yBHI0e54JpDKoZR/KZYr3Ydj3nDWsSJCvHFihOPe F2+C05rHViK/LoRf8zV/6cCVmMjfeJ+gicyFBMA+U4jjCUBAuT5wB8clFLqV0vhrnw szboHGUUzzD+ldA5f+Fo42cMIW3W9Z2nAgwbtKys= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [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 2ADB36EC44 for ; Sat, 3 Jul 2021 00:36:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2ADB36EC44 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lzQpi-0001jF-4o; Sat, 03 Jul 2021 00:36:22 +0300 To: tarantool-patches@dev.tarantool.org, olegrok@tarantool.org, yaroslav.dynnikov@tarantool.org References: Message-ID: <5c8f380f-845d-2373-4148-0c441ba01fab@tarantool.org> Date: Fri, 2 Jul 2021 23:36:20 +0200 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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD954DFF1DC42D673FBE6C6848F3EB6EB89AE0756428E32ECE9182A05F538085040DE4BD25EDF139F23C36871B59C159173ECC308565CF576506DBE29D17388498F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71107D7B19CDFFE90EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063702DFA59B3C994360EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BD6CF32B5F8F9D404C62C851DE8758A6A82A11144AF048ED8CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F924B32C592EA89F389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8EDCF5861DED71B2F389733CBF5DBD5E9B5C8C57E37DE458B9E9CE733340B9D5F3BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735BA6625F88748EAEFC4224003CC83647689D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C9783159B2D2D64495C82F8955918E15BC64BA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CBCA6440478D4BA4604370E755A8288D526AC7B952780598D9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFB1D0AC14175A0720699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3458239C6F30CE7ACFEE3A8C09AC7BBBBA9E6C098039BD652E9E559C8C482819FADFAB8B45AEEBF1401D7E09C32AA3244C1959DA670FA3199AEA512BFF527E9412C3B3ADDA61883BB5FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXhA1d6y/5LYroZKg5fXAnpv X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822D151671B168587669BFA96237524ABB63841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: [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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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 -- 2.24.3 (Apple Git-128)