From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 EC3264696C5 for ; Sat, 18 Apr 2020 23:40:03 +0300 (MSK) References: <021fb05beca144686861a6b8499088ef9e88ca28.1587223627.git.lvasiliev@tarantool.org> From: Vladislav Shpilevoy Message-ID: <0f714575-3e2a-2c07-0af2-db5df5ffe97e@tarantool.org> Date: Sat, 18 Apr 2020 22:40:02 +0200 MIME-Version: 1.0 In-Reply-To: <021fb05beca144686861a6b8499088ef9e88ca28.1587223627.git.lvasiliev@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH V5 4/6] error: add session setting for error type marshaling List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leonid Vasiliev , alexander.turenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org Thanks for the patch! I force pushed the following diff: ==================== diff --git a/src/box/lua/call.c b/src/box/lua/call.c index b7ebec3b6..6c8c353ab 100644 --- a/src/box/lua/call.c +++ b/src/box/lua/call.c @@ -380,11 +380,6 @@ execute_lua_eval(lua_State *L) struct encode_lua_ctx { struct port_lua *port; struct mpstream *stream; - /** - * Lua serializer additional options. - * To set the session specific serialization options. - */ - struct serializer_opts *serializer_opts; }; static int @@ -398,11 +393,10 @@ encode_lua_call(lua_State *L) * TODO: forbid explicit yield from __serialize or __index here */ struct luaL_serializer *cfg = luaL_msgpack_default; + struct serializer_opts *opts = ¤t_session()->meta.serializer_opts; int size = lua_gettop(ctx->port->L); - for (int i = 1; i <= size; ++i) { - luamp_encode(ctx->port->L, cfg, ctx->serializer_opts, - ctx->stream, i); - } + for (int i = 1; i <= size; ++i) + luamp_encode(ctx->port->L, cfg, opts, ctx->stream, i); ctx->port->size = size; mpstream_flush(ctx->stream); return 0; @@ -437,7 +431,6 @@ port_lua_do_dump(struct port *base, struct mpstream *stream, struct encode_lua_ctx ctx; ctx.port = port; ctx.stream = stream; - ctx.serializer_opts = ¤t_session()->meta.serializer_opts; struct lua_State *L = tarantool_L; int top = lua_gettop(L); if (lua_cpcall(L, handler, &ctx) != 0) { ====================