From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (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 3441541C5DA for ; Thu, 18 Jun 2020 11:41:59 +0300 (MSK) Date: Thu, 18 Jun 2020 11:41:12 +0300 From: Alexander Turenko Message-ID: <20200618084112.anu2bi5nscpauzco@tkn_work_nb> References: <59dfb8a35bff974f53943342fb08b1a32c71d0bd.1589321083.git.alexander.turenko@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org 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().