From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 E8B8742EF5C for ; Thu, 18 Jun 2020 01:26:40 +0300 (MSK) References: <59dfb8a35bff974f53943342fb08b1a32c71d0bd.1589321083.git.alexander.turenko@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Thu, 18 Jun 2020 00:26:39 +0200 MIME-Version: 1.0 In-Reply-To: <59dfb8a35bff974f53943342fb08b1a32c71d0bd.1589321083.git.alexander.turenko@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 3/3] box: always reconfigure box at non-first box.cfg() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Turenko , Igor Munkin Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the patch! > src/box/lua/load_cfg.lua | 8 +++++ > .../gh-4231-box-cfg-idempotence.test.lua | 34 +++++++++++++++++++ > 2 files changed, 42 insertions(+) > create mode 100755 test/box-tap/gh-4231-box-cfg-idempotence.test.lua > > diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua > index 9a7b57cd3..014379826 100644 > --- a/src/box/lua/load_cfg.lua > +++ b/src/box/lua/load_cfg.lua > @@ -571,6 +571,14 @@ setmetatable(box, { > local box_is_configured = false > > local function load_cfg(cfg) > + -- A user may save box.cfg (this function) before box loading > + -- and call it afterwards. We should reconfigure box in the > + -- case. > + if box_is_configured then > + reload_cfg(box.cfg, cfg) Shouldn't you do 'locked(reload_cfg, box.cfg, cfg)'? Otherwise you have the same problem as solved in the first commit. > + return > + end