From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 80D5846971A for ; Sat, 14 Dec 2019 15:30:58 +0300 (MSK) Received: by mail-lf1-f66.google.com with SMTP id 15so1179924lfr.2 for ; Sat, 14 Dec 2019 04:30:58 -0800 (PST) Date: Sat, 14 Dec 2019 15:30:56 +0300 From: Konstantin Osipov Message-ID: <20191214123056.GB17689@atlas> References: <20191210083258.GD21413@atlas> <2c8fe897-9a9d-849d-463e-5fadff982b8c@tarantool.org> <20191211070830.GA5953@atlas> <20191212084603.GA24448@atlas> <96368326-84a1-0b3c-15f8-54e3d044db85@tarantool.org> <20191213075850.GA21575@atlas> <60d9ec76-50be-ecae-175c-520975c928f9@tarantool.org> <20191214122644.GA17689@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191214122644.GA17689@atlas> Subject: Re: [Tarantool-patches] [PATCH 2/2] fiber: destroy fiber.storage created by iproto List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org * Konstantin Osipov [19/12/14 15:26]: > request storage is specific to Lua which doesn't have Go-style deferrables, > Python-style finally() or any other working means for controlled > garbage collection. > > Even in Lua it is better done as a third party library, which works > the same way as box.atomic(): wraps the request body with > a RAII-style function. > > This feature *is* broken & redundant, and instead of making the > damage controlled, you want to "fix" it by making the feature > universal and implementing it on C level. I checked now, and Lua addeded debug.getupvalue() to Lua C API. On other words, fiber storage now can be implemented in pure Lua, without any triggers. Back when we were writing, upvalue API was only available in C API, and AFAIR there was no way to access upvalues from Lua, this is why we had to come up with this hack. -- Konstantin Osipov, Moscow, Russia