From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 3469A24C59 for ; Thu, 12 Sep 2019 19:23:13 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lbEoNcvjSGeO for ; Thu, 12 Sep 2019 19:23:13 -0400 (EDT) Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 87A1E24A7A for ; Thu, 12 Sep 2019 19:23:12 -0400 (EDT) Date: Fri, 13 Sep 2019 02:22:54 +0300 From: Alexander Turenko Subject: [tarantool-patches] Re: [PATCH v2 1/4] app: serializers update now is reflected in Lua Message-ID: <20190912232254.twdmkuiz23gicmp2@tkn_work_nb> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Vladislav Shpilevoy Cc: tarantool-patches@freelists.org LGTM. Small comments are below. WBR, Alexander Turenko. > src/lua/utils.c | 34 +++++++++++++++------------- > test/app-tap/json.test.lua | 3 ++- > test/app-tap/lua/serializer_test.lua | 13 +++++++++++ > test/app-tap/msgpack.test.lua | 3 ++- It looks that it worth to add the test to test/app-tap/yaml.test.lua too. > 4 files changed, 35 insertions(+), 18 deletions(-) > > diff --git a/src/lua/utils.c b/src/lua/utils.c > index 75efe0ed2..a082a2e5b 100644 > --- a/src/lua/utils.c > +++ b/src/lua/utils.c > @@ -270,10 +270,8 @@ luaL_serializer_parse_option(struct lua_State *L, int i, > struct luaL_serializer *cfg) Now the function pushes a value to a Lua stack, I think it worth to update the doxygen-style comment. > /** > - * @brief serializer.cfg{} Lua binding for serializers. > - * serializer.cfg is a table that contains current configuration values from > - * luaL_serializer structure. serializer.cfg has overriden __call() method > - * to change configuration keys in internal userdata (like box.cfg{}). > - * Please note that direct change in serializer.cfg.key will not affect > - * internal state of userdata. The note is still actual, I would not remove it. ( Sooner or later we should just do https://github.com/tarantool/tarantool/issues/2867 ) Side note: I think that it is better to have one source of information and have only a handle in Lua. Or maybe (if option(s) access cost is matter) update the Lua table using some kind of triggers: if we'll change an option from C, then the current implementation will fail to track it. Anyway, it is not a part of your issue. Just side thoughts.