You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Manas Agarwal <ma...@gmail.com> on 2013/01/16 18:35:50 UTC

Regarding TSVConnClose, Transformations and CacheWrite

Hi All,

I am trying to do a plugin cache write during response transformation.

After I read the read the data and do the data transformation, I perform
the cache write.

However, in the event VCONN_WRITE_COMPLETE, I try to close the output vconn.

I also close the transform vconn as showed in the null transform example.

However I get sometimes only one event TS_EVENT_IMMEDIATE based on TSVConnClose
call.
At other times I get two events.

Can somebody suggest me why I am getting this random behavior.

Regards,
Manas

Re: Regarding TSVConnClose, Transformations and CacheWrite

Posted by Manas Agarwal <ma...@gmail.com>.
Hi Alan,

Thanks for the reply.
If that is the case, how I handle the issue of freeing the memory.
>From the cache write complete event, I do a close call.
However both these close(null transform and cache close) are going to the null
transform handler instead of the cache close going to cache close handler.
There I am facing the issue of freeing the memory.

Also there is one more issue-
After the pluggin is loaded and I get a  read request, I perform a
cache read call.
There I decide based on response that if the previous cache write was
successful or not.
However if the cache read call is executed after the read call is
complete, then
I will always have to perform remaps. I am trying to avoid locks so
that there is less drop in performance.

Also the above scenario works in most of the cases in single server(ie
cache read call is complete before the control comes to read request
flow.
However when I have ATS cluster, the event starts misbehaving.

Any suggestions for correcting this behavior.

Regards,
Manas




On 1/17/13, Alan M. Carroll <am...@network-geographics.com> wrote:
> Based on my experience this is really just random. The transform output is
> being sent to a splitter which sends data to the cache and the client. Both
> of these can generate upstream events and which you get precisely depends on
> they drain out relative to each other. This in turn depends on disk writes
> and network flows. You should be able to write your code so that it is not
> critical what exact set of events you get as long as you get something.
>
> Wednesday, January 16, 2013, 11:35:50 AM, you wrote:
>
>> Hi All,
>
>> I am trying to do a plugin cache write during response transformation.
>
>
>> After I read the read the data and do the data transformation, I perform
>> the cache write.
>>
>
>> However, in the event VCONN_WRITE_COMPLETE, I try to close the output
>> vconn.
>
>
>> I also close the transform vconn as showed in the null transform example.
>
>
>> However I get sometimes only one event TS_EVENT_IMMEDIATE based on
>> TSVConnClose call.
>>  At other times I get two events.
>
>

Re: Regarding TSVConnClose, Transformations and CacheWrite

Posted by Manas Agarwal <ma...@gmail.com>.
Hi Alan,

Thanks for the reply.
If that is the case, how I handle the issue of freeing the memory.
>From the cache write complete event, I do a close call.
However both these close(null transform and cache close) are going to the null
transform handler instead of the cache close going to cache close handler.
There I am facing the issue of freeing the memory.

Also there is one more issue-
After the pluggin is loaded and I get a  read request, I perform a
cache read call.
There I decide based on response that if the previous cache write was
successful or not.
However if the cache read call is executed after the read call is
complete, then
I will always have to perform remaps. I am trying to avoid locks so
that there is less drop in performance.

Also the above scenario works in most of the cases in single server(ie
cache read call is complete before the control comes to read request
flow.
However when I have ATS cluster, the event starts misbehaving.

Any suggestions for correcting this behavior.

Regards,
Manas




On 1/17/13, Alan M. Carroll <am...@network-geographics.com> wrote:
> Based on my experience this is really just random. The transform output is
> being sent to a splitter which sends data to the cache and the client. Both
> of these can generate upstream events and which you get precisely depends on
> they drain out relative to each other. This in turn depends on disk writes
> and network flows. You should be able to write your code so that it is not
> critical what exact set of events you get as long as you get something.
>
> Wednesday, January 16, 2013, 11:35:50 AM, you wrote:
>
>> Hi All,
>
>> I am trying to do a plugin cache write during response transformation.
>
>
>> After I read the read the data and do the data transformation, I perform
>> the cache write.
>>
>
>> However, in the event VCONN_WRITE_COMPLETE, I try to close the output
>> vconn.
>
>
>> I also close the transform vconn as showed in the null transform example.
>
>
>> However I get sometimes only one event TS_EVENT_IMMEDIATE based on
>> TSVConnClose call.
>>  At other times I get two events.
>
>

Re: Regarding TSVConnClose, Transformations and CacheWrite

Posted by "Alan M. Carroll" <am...@network-geographics.com>.
Based on my experience this is really just random. The transform output is being sent to a splitter which sends data to the cache and the client. Both of these can generate upstream events and which you get precisely depends on they drain out relative to each other. This in turn depends on disk writes and network flows. You should be able to write your code so that it is not critical what exact set of events you get as long as you get something.

Wednesday, January 16, 2013, 11:35:50 AM, you wrote:

> Hi All,

> I am trying to do a plugin cache write during response transformation.


> After I read the read the data and do the data transformation, I perform the cache write.
>  

> However, in the event VCONN_WRITE_COMPLETE, I try to close the output vconn.


> I also close the transform vconn as showed in the null transform example.


> However I get sometimes only one event TS_EVENT_IMMEDIATE based on TSVConnClose call.
>  At other times I get two events.