[Tarantool-patches] [PATCH 3/3] box: always reconfigure box at non-first box.cfg()

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Jun 19 01:23:32 MSK 2020


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.


More information about the Tarantool-patches mailing list