Re: TSHttpHookAdd() thread safety

2018-12-13 Thread Walt Karas
Nevermind, I think I see now that the continuations on a hook are serialized. Submitted https://github.com/apache/trafficserver/pull/4707 since this unused code got me confused. On Thu, Dec 13, 2018 at 2:35 PM Walt Karas wrote: > Can anyone explain the mutual exclusion mechanism when different

Re: TSHttpHookAdd() thread safety

2018-12-13 Thread Walt Karas
Can anyone explain the mutual exclusion mechanism when different plugins call TSHttpTxnHookAdd() for the same hook on the same transaction? On Thu, Dec 13, 2018 at 12:15 PM xuchao@Gmail wrote: > yes! > > The TSHttpHookAdd() should _only_ and _always_ be > called from TSPluginInit() or TSRemapIni

Re: TSHttpHookAdd() thread safety

2018-12-13 Thread xuchao@Gmail
yes! The TSHttpHookAdd() should _only_ and _always_ be called from TSPluginInit() or TSRemapInit(). - oknet 发自我的 iPhone > 在 2018年12月13日,23:42,Walt Karas 写道: > > TSHttpHookAdd() should _only_ be > called from TSPluginInit() or TSRemapInit().

Re: TSHttpHookAdd() thread safety

2018-12-13 Thread Walt Karas
Chao Xu it seems you are saying that TSHttpHookAdd() should _only_ be called from TSPluginInit() or TSRemapInit(). Which would mean that the documentation is incorrect in implying that there are some cases where it should be called later. On Thu, Dec 13, 2018 at 3:14 AM Chao Xu wrote: > The plu

Re: TSHttpHookAdd() thread safety

2018-12-13 Thread Chao Xu
The plugins are loaded and initialized within Main.cc by calling plugin_init() one by one. The global hooks list is initialized before any http port / service is ready to serve. There is no thread issue because all the threads are blocked for incoming events. - oknet Walt Karas 于2018年12月13日周四

Re: TSHttpHookAdd() thread safety

2018-12-12 Thread Walt Karas
I don't understand your and answer Leif. You can't possibly call those function from TSPluginInit() or TSRemapInit(). On Wed, Dec 12, 2018 at 7:01 PM Leif Hedstrom wrote: > > > > On Dec 12, 2018, at 4:54 PM, Walt Karas wrote: > > > > The documentation says that TS API functionTSHttpHookAdd() i

Re: TSHttpHookAdd() thread safety

2018-12-12 Thread Leif Hedstrom
> On Dec 12, 2018, at 4:54 PM, Walt Karas wrote: > > The documentation says that TS API functionTSHttpHookAdd() is _typically_ > called from TSPluginInit() or TSRemapInit(). The implementation of > TSHttpHookAdd() doesn't look thread-safe, so how could it be called > anywhere else? I don’t

TSHttpHookAdd() thread safety

2018-12-12 Thread Walt Karas
The documentation says that TS API functionTSHttpHookAdd() is _typically_ called from TSPluginInit() or TSRemapInit(). The implementation of TSHttpHookAdd() doesn't look thread-safe, so how could it be called anywhere else?