Hello,
I am not sure if this question should be directed to the users or the dev
discussion group so please advise on proper categorization of this inquiry.
I am trying to debug a transformation plugin that I have developed that
simply prepends and appends a small string to whatever content is being
returned to the client.
About 70% of the time this plugin works as expected and writes the prefix
and suffix and the entire content is delivered to the client.
However about 30% of the time the content is truncated at the client even
though the trace logging indicates that all of the content was written to
the output VIO.
It seems to be a race condition wherein sometimes the transaction is shut
down before ATS delivers all of the content to the client.
The only API call I am making from within my plugin that could indicate to
ATS that we are done with processing is
TSVConnShutdown(TSTransformOutputVConnGet(contp), 0, 1);
I am making this call in response to a TS_EVENT_VCONN_WRITE_COMPLETE
subject to the following conditions:
1. I have already written all content that I am ever going to write to the
Output VIO e.g 33993 bytes in total.
2. I have confirmed that the output_vio.nbytes = 33993; output_vio.ndone=
33993.
I do not make the call to
TSVConnShutdown(TSTransformOutputVConnGet(contp), 0, 1) unless both
conditions are met.
YET, for some reason in about 1/3 of the times the code executes, the
content is truncated and I am observing things in my logs that indicate
that something has shut down the transaction.
My question is what more can I do to ensure that ATS behaves reliably and
delivers the content that I have written to the output vio to the client?
Best Regards,
Steve Owens