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 F16D36FC8E; Sat, 24 Apr 2021 02:15:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F16D36FC8E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1619219758; bh=ZKk04EBKBu65xAchajL5ib9nNIsD6SoEozYGPrbS8aM=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qy38IGJwQ1ufdLBXfydjNhU30fBTqC4/luRyeoH39675np1Ek9qvSgCVR9ysvWxN4 Xv5ndawH2o8LTx3b0576V7mhenrYcIpYF+Jb/mT/yI6T1kPqTcqDMWosFEyZGen5EC jM9rdy3UnGtATrRFeocsrui9K+siA5DYgppB0u1k= 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 BDA776EC63 for ; Sat, 24 Apr 2021 02:15:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BDA776EC63 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1la51f-0006fA-IB; Sat, 24 Apr 2021 02:15:56 +0300 To: tarantool-patches@dev.tarantool.org, gorcunov@gmail.com, sergepetrenko@tarantool.org Date: Sat, 24 Apr 2021 01:15:52 +0200 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9203E2ABA940B7548357B9CFC828CE9D01715FF06786BA240182A05F538085040FC1680D24B43F49182444CB522002A92FB505A2489A3D4D3EB486D6CBAEBC4E4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7461BBD5973015A08EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375FE8AD9F0D2764EB8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2056AE1F8BF4A96814E0F110D37962C8C85184F9B92705903D2E47CDBA5A96583C09775C1D3CA48CFCF36E64A7E3F8E58117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7A6779F98BF527B7A9FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA71A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F83C798A30B85E16BCE5475246E174218B5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CB6E146CBBBB42ED6A67B303A054DE1F7E68DE65C1A84DC259C2B6934AE262D3EE7EAB7254005DCEDB7EFC714DBEEC1D51E0A4E2319210D9B64D260DF9561598F01A9E91200F654B0279E343DB675BB2F8E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A783A638E01A3CDE8CA483FC90323757882D34A3053DF6D504C35B3B5C06B46A08EA6008C16A84421D7E09C32AA3244C14A94AA972CA8C0A2B30DC3FCE88E68E795D98D676DD64D0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojfZPPuXuuvpScKzBlXD4f3A== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822999646C006A44BCCEBA3B7F3487F18C13841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH 0/2] fiber_wakeup() nop on self 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" The patchset makes fiber_wakeup() in C and fiber.wakeup() in Lua nop when called on the current fiber. This fixes a couple of crashes in the public API, and prevent spurious wakeups in certain cases. Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-5292-6043-fiber-wakeup-nop Issue: https://github.com/tarantool/tarantool/issues/5292 Issue: https://github.com/tarantool/tarantool/issues/6043 Vladislav Shpilevoy (2): fiber: make wakeup in Lua and C nop on self fiber: use wakeup safely on self everywhere .../unreleased/gh-6043-fiber-wakeup-self.md | 33 +++++++ src/box/applier.cc | 4 +- src/box/journal.c | 6 ++ src/box/journal.h | 7 ++ src/box/raft.c | 14 +-- src/box/txn.c | 6 +- src/box/txn_limbo.c | 14 +-- src/lib/core/fiber.c | 85 +++++++++++-------- src/lib/core/fiber.h | 6 +- src/lib/swim/swim.c | 1 - .../gh-6043-fiber-wakeup-self.test.lua | 50 +++++++++++ test/unit/fiber.cc | 33 ++++++- test/unit/fiber.result | 2 + test/unit/fiber_stress.cc | 6 +- 14 files changed, 191 insertions(+), 76 deletions(-) create mode 100644 changelogs/unreleased/gh-6043-fiber-wakeup-self.md create mode 100755 test/app-tap/gh-6043-fiber-wakeup-self.test.lua -- 2.24.3 (Apple Git-128)