You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by dabue <88...@qq.com> on 2020/10/30 12:42:49 UTC

[DISCUSS]: should we distinguish the reload of plugin's metadata from the reload of plugin's function?

APISIX plug-ins are hot-loaded, it's very convenient. But there are some tiny faults when we use timer in global plug-ins, just like 'log-rotate'.
There will be more then one timer when we update the attributes of 'log-rotate' plug-in by reload.
You will find ‘pkg_loaded[pkg_name] = nil’ in Line 63 of apisix/plugin.lua, the earlier timer created will be out of control when we reload the plug-in.
Should we distinguish the reload of plugin's metadata from the reload of plugin's function, provide a way to update the configuration only?



88786912@qq.com

Re: [DISCUSS]: should we distinguish the reload of plugin's metadata from the reload of plugin's function?

Posted by YuanSheng Wang <me...@apache.org>.
add a new api named `_M.destroy`, is it enough?

^_^

On Fri, Oct 30, 2020 at 8:42 PM dabue <88...@qq.com> wrote:

> APISIX plug-ins are hot-loaded, it's very convenient. But there are some
> tiny faults when we use timer in global plug-ins, just like 'log-rotate'.
> There will be more then one timer when we update the attributes of
> 'log-rotate' plug-in by reload.
> You will find ‘pkg_loaded[pkg_name] = nil’ in Line 63 of
> apisix/plugin.lua, the earlier timer created will be out of control when we
> reload the plug-in.
> Should we distinguish the reload of plugin's metadata from the reload of
> plugin's function, provide a way to update the configuration only?
>
>
>
> 88786912@qq.com
>


-- 

*MembPhis*
My GitHub: https://github.com/membphis
Apache APISIX: https://github.com/apache/apisix