You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Leif Hedstrom <zw...@apache.org> on 2023/10/23 00:05:35 UTC

[API proposal] Adding a third optional argument to TSMgmtUpdateRegister

I’d like to update the existing API for TSMgmtUpdateRegister(), to add a third, optional argument:


void TSMgmtUpdateRegister(TSCont contp, const char *plugin_name, const char *plugin_file_name = nullptr);


The old behavior (without providing this plugin_file_name) remains the same. However, when provided, the core takes care of tracking the modification timestamps on the file, and the configuration reload continuation (contp above) would only be called if the file has been modified when “traffic_ctl config reload” is invoked.

The “plugin_name” is left as-is, even though it’s currently unused. There’s no way right now to only “reload” a single (or list) of plugins, but it would in theory at least be possible to add such a feature. I’m skeptical to this being useful, but leaving the plugin_name seems harmless, and also allows for more debugging when needed. And it keeps the API backwards compatible with 9.2.x.

— Leif


https://github.com/apache/trafficserver/pull/10642

Re: [API proposal] Adding a third optional argument to TSMgmtUpdateRegister

Posted by Shu Kit Chan <ch...@gmail.com>.
+1

On Sun, Oct 22, 2023 at 5:05 PM Leif Hedstrom <zw...@apache.org> wrote:
>
> I’d like to update the existing API for TSMgmtUpdateRegister(), to add a third, optional argument:
>
>
> void TSMgmtUpdateRegister(TSCont contp, const char *plugin_name, const char *plugin_file_name = nullptr);
>
>
> The old behavior (without providing this plugin_file_name) remains the same. However, when provided, the core takes care of tracking the modification timestamps on the file, and the configuration reload continuation (contp above) would only be called if the file has been modified when “traffic_ctl config reload” is invoked.
>
> The “plugin_name” is left as-is, even though it’s currently unused. There’s no way right now to only “reload” a single (or list) of plugins, but it would in theory at least be possible to add such a feature. I’m skeptical to this being useful, but leaving the plugin_name seems harmless, and also allows for more debugging when needed. And it keeps the API backwards compatible with 9.2.x.
>
> — Leif
>
>
> https://github.com/apache/trafficserver/pull/10642