From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (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 746F5469719 for ; Sat, 15 Feb 2020 04:02:04 +0300 (MSK) From: Vladislav Shpilevoy References: Message-ID: <10959318-c12c-7b9c-4432-1f6619a3b8c4@tarantool.org> Date: Sat, 15 Feb 2020 02:02:01 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 0/3] Fiber storage leak List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, kostja.osipov@gmail.com Pushed to the master, 2.3, 2.2, 1.10. In 1.10 I didn't port the last commit, because in 1.10 fiber.on_stop triggers for transactions are installed differently. @ChangeLog - fiber.storage is cleaned between requests, and can be used as a request-local storage. Previously it was possible, that fiber.storage would contain some old values in the beginning of an iproto request execution, and it needed to be nullified manually. Now it is not needed (gh-4662). On 16/01/2020 22:54, Vladislav Shpilevoy wrote: > The patchset makes fiber.storage be always deleted. Regardless of > where was it created - in a fiber born in the Lua land, or in a > fiber serving IProto requests and accessing Lua. > > That removes > > - a leak occurred each time when fiber storage was created for > an IProto request; > > - a possibility to see previous request's artifacts left in > fiber.storage; > > And makes possible to use fiber.storage as request-local data. > > Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-4662-fiber-storage-leak > Issue: https://github.com/tarantool/tarantool/issues/4662 > > Changes in v2: > - Renamed back fiber.on_cleanup -> fiber.on_stop; > - Removed dead code from box_process_call/eval(), which is now > handled by iproto. > > Vladislav Shpilevoy (3): > fiber: unref fiber.storage via global Lua state > fiber: destroy fiber.storage created by iproto > box: remove dead code from box_process_call/eval() > > src/box/call.c | 28 +------ > src/box/iproto.cc | 44 ++++++++-- > src/box/txn.c | 1 + > src/lib/core/fiber.c | 18 +++- > src/lib/core/fiber.h | 14 +++- > src/lua/fiber.c | 35 ++++++-- > test/app/gh-4662-fiber-storage-leak.result | 88 ++++++++++++++++++++ > test/app/gh-4662-fiber-storage-leak.test.lua | 43 ++++++++++ > 8 files changed, 230 insertions(+), 41 deletions(-) > create mode 100644 test/app/gh-4662-fiber-storage-leak.result > create mode 100644 test/app/gh-4662-fiber-storage-leak.test.lua >