From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (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 B3B4A469710 for ; Mon, 8 Jun 2020 19:35:19 +0300 (MSK) Date: Mon, 8 Jun 2020 19:35:17 +0300 From: Sergey Ostanevich Message-ID: <20200608163517.GE50@tarantool.org> References: <20200602121949.20254-1-skaplun@tarantool.org> <20200602135140.GC5745@tarantool.org> <20200602141636.GA8942@root> <20200602141303.GD5745@tarantool.org> <20200602150104.GA14098@root> <20200602165714.GC50@tarantool.org> <20200605071443.GA5027@root> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200605071443.GA5027@root> Subject: Re: [Tarantool-patches] [PATCH v2] lua: remove excess Lua call from table encoding List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy Hi! The patch looks ok after I figured out that you actually sink the pcall down the callstack, keeping it only for the case __serialize is a function, leaving all other cases as is. What misled me is the changelog, where you mentioned you _removed_ protected frame: * Refactor Lua table encoding: removed excess Lua function object and protected Lua frame creation to improve `msgpack.encode()` performance. I believe it'll be better to update the changelog descripton. LGTM, Sergos On 05 июн 10:14, Sergey Kaplun wrote: > Hi! > > It's a little bit complicated to find a good test that shows the > difference of behaviour. AFAIK there is only one case when we can face > with OOM error or so on - reallocating of Lua stack. But it can happen > with old version too (when we push cfunction, table or lightuserdata at > Lua stack before pcall). Now instead three values we push at Lua stack > only two (Lua function from metatable and table itself if serializing > function exists) before pcall. So with this patch the probability of > raising OOM error should be decreased. > > Of course we can check it with an eror injection, but it can be catched > with old behaviour too. It will be nice if you can provide any idea of > this kind of test to check this. > > On 02.06.20, Sergey Ostanevich wrote: > > Hi! > > > > Thanks for the patch! > > > > Still I would like to see some tests - perhaps with errinj to emulate > > OOM or some other case that trigger the 'excess protected frame' need. > > So that after your changes it still passes. > > > > Regards, > > Sergos > > > > -- > Best regards, > Sergey Kaplun