Re: [E] Proposal: make utilities declared in Cleanup.h part of TS API

2023-09-05 Thread Walt Karas
Where would we put it? Just copy it into each plugin where it's used? Have each plugin rewrite code to support RAII? On Tue, Sep 5, 2023 at 1:01 PM Chris McFarlen wrote: > I would advocate for a much higher level plugin API in the direction of > Cripts that encapsulates much of the minutia of h

Re: [E] Proposal: make utilities declared in Cleanup.h part of TS API

2023-09-05 Thread Chris McFarlen
I would advocate for a much higher level plugin API in the direction of Cripts that encapsulates much of the minutia of hooking into the transaction lifecycle and reduces the rote boilerplate that exists in current plugins. Hopefully something that will cover the vast majority of use cases with

Re: [E] Proposal: make utilities declared in Cleanup.h part of TS API

2023-09-05 Thread Walt Karas
Would it be possible to propose concrete alternatives? We can't just simply delete Cleanup.h, the xdebug plugin won't compile. On Tue, Sep 5, 2023 at 12:27 PM Chris McFarlen wrote: > I have read through Cleanup.h and its uses and I agree this is not a style > we should promote. This code alrea

Re: [E] Proposal: make utilities declared in Cleanup.h part of TS API

2023-09-05 Thread Chris McFarlen
I have read through Cleanup.h and its uses and I agree this is not a style we should promote. This code already feels like tech debt in that its bridging C and C++ APIs in a bolt-on fashion that I think we will want to deprecate shortly. While certainly RAII and "smart" pointers are important

Re: [E] Proposal: make utilities declared in Cleanup.h part of TS API

2023-09-05 Thread Masakazu Kitajo
I was not talking about the need to use RAII. I just don't think we should promote Cleanup.h. On Tue, Sep 5, 2023 at 7:28 AM Walt Karas wrote: > It seems that some are not convinced of the need to use RAII. I won' t get > into that, it's easy to find writeups advocating for it, which are better

Re: [E] Proposal: make utilities declared in Cleanup.h part of TS API

2023-09-05 Thread Walt Karas
It seems that some are not convinced of the need to use RAII. I won' t get into that, it's easy to find writeups advocating for it, which are better than anything I could write. I have no strong feelings about how things are spelled or abbreviated. On Sat, Sep 2, 2023 at 11:22 PM James Peach wr

Re: [E] Proposal: make utilities declared in Cleanup.h part of TS API

2023-09-02 Thread James Peach
> On 2 Sep 2023, at 3:44 am, Masakazu Kitajo wrote: > >> Its a judgement call, how much to minimize the API. > > Yes, that's why we send API proposals on the dev list. And I don't think > I'm absolutely right. If we, as a community, want to have utilities as TS > API, that's what we should do.

Re: [E] Re: Proposal: make utilities declared in Cleanup.h part of TS API

2023-09-01 Thread Masakazu Kitajo
> Its a judgement call, how much to minimize the API. Yes, that's why we send API proposals on the dev list. And I don't think I'm absolutely right. If we, as a community, want to have utilities as TS API, that's what we should do. I'm disappointed that others don't join this discussion, but if th

Re: [E] Re: Proposal: make utilities declared in Cleanup.h part of TS API

2023-08-31 Thread Walt Karas
We could also change the API so it provided plugins with raw HTTP headers, and let each plugin parse the headerd. Its a judgement call, how much to minimize the API. Scenario 1. We continue to write code without RAII. We have resulting resource leaks. We (potentially) find a way to put RAII in

Re: [E] Re: Proposal: make utilities declared in Cleanup.h part of TS API

2023-08-31 Thread Masakazu Kitajo
I don't see why we want to provide a helmet with TS API mark. Somebody may make a third party helmet which is better than ours. Can we steal the design? Can we make a much better one? I'm not sure because that may require interface change and/or behavior change. Then ours would be useless. It's not

Re: [E] Re: Proposal: make utilities declared in Cleanup.h part of TS API

2023-08-31 Thread Walt Karas
The analogy I would make is to needing a helmet to ride a motorcycle. You don' t need it in the strictest sense, but you need it for a reasonable level of safety. You need RAII for a reasonable level of safety against resource leaks. On Thu, Aug 31, 2023 at 1:50 PM Masakazu Kitajo wrote: > I s

Re: [E] Re: Proposal: make utilities declared in Cleanup.h part of TS API

2023-08-31 Thread Masakazu Kitajo
I see your point, but I think we need to draw a line. High-priority capability is blurry and questionable. We have not *needed* it for years. > We could support RAII better, but I don't think it's feasible in 10.0. This implies Cleanup.h will be unnecessary after we make it better. Not discardin

Re: [E] Re: Proposal: make utilities declared in Cleanup.h part of TS API

2023-08-30 Thread Walt Karas
The utilities in Cleanup.h add RAII capabilities to the TS API. I hope we don't need to have a debate about the value of RAII. Certainly, any API can become bloated with too many features. But RAII seems like a high-priority capability to support. We could support RAII better, but I don't think

Re: Proposal: make utilities declared in Cleanup.h part of TS API

2023-08-30 Thread Masakazu Kitajo
I wonder what should be part of TS API. There may be some exceptions, but TS API basically provides things that can only be done on ATS core. Question for all, would we want to have utilities as TS API? -- Masakazu On Tue, Aug 22, 2023 at 11:48 AM Walt Karas wrote: > See the PR https://github.

Proposal: make utilities declared in Cleanup.h part of TS API

2023-08-22 Thread Walt Karas
See the PR https://github.com/apache/trafficserver/pull/10231 . Cleanup.h is currently available to plugins in include/tscpp/api . The proposal is to move it to include/ts . The declarations currently in the atscppapi namespace are moved to the tsapi::c_support namespace. The c_support sub-name