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

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Jun 18 01:26:39 MSK 2020


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


More information about the Tarantool-patches mailing list