Thank you, James and Leif for your reply. There are couple of problems
that I had while using TSReconfigure (from mgmtapi.h).

There are some functions which have been defined in both ‘ts.h’ and
‘mgmtapi.h’ with different argument types which leads to conflict as both
of them are C APIs, and function overloading is now allowed there.

For Example : In ‘ts.h’ _TSstrdup() has been defined as

tsapi char *_TSstrdup(const char *str, *int64_t length*, const char *path);

the same function has been defined in mgmtapi.h as

tsapi char *_TSstrdup(const char *str, *int length*, const char *path);

There are similar other functions like _TSmalloc() and _TSrealloc(), which
are defined in both the APIs, and have different argument types like
‘size_t’ and ‘unsigned int’.  Since I need both ‘ts.h’ and ‘mgmtapi.h’
inside my plugin I get compile time failure mentioning conflicts while
building my plugin.

The other reason why I am not inclined towards using TSReconfigure(), is
because it reloads remap.config asynchronously by signaling event to
LocalManager. Because of this, if a faulty remap.config is getting
reloaded, our plugin code will have no way to know that an error has
happened. In case of failure we want to inform other systems like send an
event to monitoring system.

Also ‘TSReconfigure()’ reloads all the configs where as our use case is to
just reload remap.config  (as it gets changed frequently) where as other
configs config changes are not frequent and have other mechanism of getting
deployed.

One other alternative that I have is to define reloadUrlRewrite() function
inside my plugin with an ‘extern’ identifier. That way I will be able to
use this to reload the reamp.config file without having a compile time
error, and at runtime the corresponding implementation inside
ReverseProxy.cc will be called. Since this code is being run as a part of
async thread, I don't mind it being blocking. Just wanted to get your
thought on this one.


Regards,
Nishant

On Fri, May 19, 2017 at 1:50 PM, Leif Hedstrom <zw...@apache.org> wrote:

>
> > On May 17, 2017, at 4:54 PM, Nishant Gaurav <ngau...@linkedin.com.INVALID>
> wrote:
> >
> > Hi everyone,
> >
> > I work as a part of Traffic team at LinkedIn. Our team has a use case
> where
> > we want to reload ‘remap.config’ without restarting trafficserver. I
> > understand that I can use ‘traffic_ctl config reload’ command for the
> same,
> > but we don’t want dependence on an external process to run traffic_ctl.
> >
> > In order to achieve this I submitted this pull request
> > <https://github.com/apache/trafficserver/pull/1815/files> last week, in
> > which I introduced a new API function 'TSRemapConfigReload()' which can
>
>
> Hmmm, not sure I fully understand this, but why wouldn’t you use the Mgmt
> C-API for this in your plugin? You don’t need a new TS API for that, no?
> I’m sure you can look at the code for traffic_ctl, and see how it uses the
> mgmt C-APIs to do the config reload.
>
> Or what am I missing? :-)
>
> Cheers,
>
> — leif
>
>

Reply via email to