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 5A36841C5DA for ; Fri, 19 Jun 2020 01:23:34 +0300 (MSK) References: <59dfb8a35bff974f53943342fb08b1a32c71d0bd.1589321083.git.alexander.turenko@tarantool.org> <20200618084112.anu2bi5nscpauzco@tkn_work_nb> From: Vladislav Shpilevoy Message-ID: Date: Fri, 19 Jun 2020 00:23:32 +0200 MIME-Version: 1.0 In-Reply-To: <20200618084112.anu2bi5nscpauzco@tkn_work_nb> 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 Cc: tarantool-patches@dev.tarantool.org On 18/06/2020 10:41, Alexander Turenko wrote: > On Thu, Jun 18, 2020 at 12:26:39AM +0200, Vladislav Shpilevoy wrote: >> 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. > > We should not. load_cfg() is always called under the lock unlike > box.execute(). Ok, I see. Then the patchset LGTM.