You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Michael Graham <mg...@bloxx.com> on 2015/06/03 22:34:44 UTC
Re: TS_EVENT_ERROR from transform hook
Hi all,
I emailed the -users list earlier today thinking I had an issue in a
plugin I was writing but after further investigation I'm starting to
think this is a bug in TS.
Below you will see that TS is returning an error response which contains
both TE chunked and a content length. I think this is because of this
section of HttpTransact::HandleApiErrorJump(...)
if (s->hdr_info.client_response.valid()) {
s->hdr_info.client_response.fields_clear();
s->source = SOURCE_INTERNAL;
}
If I set s->source regardless of valid() then I get the following
(correct) response from TS:
HTTP/1.1 500 INKApi Error
Date: Wed, 03 Jun 2015 20:13:32 GMT
Proxy-Connection: close
Server: ATS/5.1.2
X-Cache: MISS from death-cache
Content-Length: 0
Thoughts? Should I raise a bug?
Thanks,
On Wed, 2015-06-03 at 14:00 -0400, Michael Graham wrote:
> Hi all,
>
> I'm trying to write some simple plugins to test out using Traffic Server
> and I am struggling to work out how to trigger a TS_EVENT_ERROR
> correctly from inside a response transform.
>
> Basically I started with the bnull-transform and added:
>
> TSContCall(..., TS_EVENT_ERROR, ...);
>
> After the buffering had finished but before the call to
> TSVConnWrite(...).
>
> I then make a request via Traffic Server and I see:
>
> http_proxy=127.0.0.1:6045 curl -v www.airfix.com/us-en/
> * About to connect() to proxy 127.0.0.1 port 6045 (#0)
> * Trying 127.0.0.1... connected
> > GET HTTP://www.airfix.com/us-en/ HTTP/1.1
> > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0
> OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> > Host: www.airfix.com
> > Accept: */*
> > Proxy-Connection: Keep-Alive
> >
> < HTTP/1.1 500 INKApi Error
> < Date: Wed, 03 Jun 2015 17:51:22 GMT
> < Transfer-Encoding: chunked
> < Proxy-Connection: keep-alive
> < Server: ATS/5.1.2
> < X-Cache: MISS from death-cache
> < Content-Length: 0
> <
>
> After a long(-ish) wait curl will exit with:
>
> * transfer closed with outstanding read data remaining
> * Closing connection #0
>
> It seems a little odd that TS is sending both TE chunked and a
> content-length of 0 but it never actually sends any chunks not even an
> empty one. Am I doing something wrong?
>
> Thanks,
--
Michael Graham <mg...@bloxx.com>
Re: TS_EVENT_ERROR from transform hook
Posted by Sudheer Vinukonda <su...@yahoo-inc.com>.
Agree that this is a bug and the proposed solution looks good to me - Can you please open a jira and submit a PR with the change?
Thanks,
Sudheer
On Wednesday, June 3, 2015 1:36 PM, Michael Graham <mg...@bloxx.com> wrote:
Hi all,
I emailed the -users list earlier today thinking I had an issue in a
plugin I was writing but after further investigation I'm starting to
think this is a bug in TS.
Below you will see that TS is returning an error response which contains
both TE chunked and a content length. I think this is because of this
section of HttpTransact::HandleApiErrorJump(...)
if (s->hdr_info.client_response.valid()) {
s->hdr_info.client_response.fields_clear();
s->source = SOURCE_INTERNAL;
}
If I set s->source regardless of valid() then I get the following
(correct) response from TS:
HTTP/1.1 500 INKApi Error
Date: Wed, 03 Jun 2015 20:13:32 GMT
Proxy-Connection: close
Server: ATS/5.1.2
X-Cache: MISS from death-cache
Content-Length: 0
Thoughts? Should I raise a bug?
Thanks,
On Wed, 2015-06-03 at 14:00 -0400, Michael Graham wrote:
> Hi all,
>
> I'm trying to write some simple plugins to test out using Traffic Server
> and I am struggling to work out how to trigger a TS_EVENT_ERROR
> correctly from inside a response transform.
>
> Basically I started with the bnull-transform and added:
>
> TSContCall(..., TS_EVENT_ERROR, ...);
>
> After the buffering had finished but before the call to
> TSVConnWrite(...).
>
> I then make a request via Traffic Server and I see:
>
> http_proxy=127.0.0.1:6045 curl -v www.airfix.com/us-en/
> * About to connect() to proxy 127.0.0.1 port 6045 (#0)
> * Trying 127.0.0.1... connected
> > GET HTTP://www.airfix.com/us-en/ HTTP/1.1
> > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0
> OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> > Host: www.airfix.com
> > Accept: */*
> > Proxy-Connection: Keep-Alive
> >
> < HTTP/1.1 500 INKApi Error
> < Date: Wed, 03 Jun 2015 17:51:22 GMT
> < Transfer-Encoding: chunked
> < Proxy-Connection: keep-alive
> < Server: ATS/5.1.2
> < X-Cache: MISS from death-cache
> < Content-Length: 0
> <
>
> After a long(-ish) wait curl will exit with:
>
> * transfer closed with outstanding read data remaining
> * Closing connection #0
>
> It seems a little odd that TS is sending both TE chunked and a
> content-length of 0 but it never actually sends any chunks not even an
> empty one. Am I doing something wrong?
>
> Thanks,
--
Michael Graham <mg...@bloxx.com>
Re: TS_EVENT_ERROR from transform hook
Posted by Sudheer Vinukonda <su...@yahoo-inc.com.INVALID>.
Agree that this is a bug and the proposed solution looks good to me - Can you please open a jira and submit a PR with the change?
Thanks,
Sudheer
On Wednesday, June 3, 2015 1:36 PM, Michael Graham <mg...@bloxx.com> wrote:
Hi all,
I emailed the -users list earlier today thinking I had an issue in a
plugin I was writing but after further investigation I'm starting to
think this is a bug in TS.
Below you will see that TS is returning an error response which contains
both TE chunked and a content length. I think this is because of this
section of HttpTransact::HandleApiErrorJump(...)
if (s->hdr_info.client_response.valid()) {
s->hdr_info.client_response.fields_clear();
s->source = SOURCE_INTERNAL;
}
If I set s->source regardless of valid() then I get the following
(correct) response from TS:
HTTP/1.1 500 INKApi Error
Date: Wed, 03 Jun 2015 20:13:32 GMT
Proxy-Connection: close
Server: ATS/5.1.2
X-Cache: MISS from death-cache
Content-Length: 0
Thoughts? Should I raise a bug?
Thanks,
On Wed, 2015-06-03 at 14:00 -0400, Michael Graham wrote:
> Hi all,
>
> I'm trying to write some simple plugins to test out using Traffic Server
> and I am struggling to work out how to trigger a TS_EVENT_ERROR
> correctly from inside a response transform.
>
> Basically I started with the bnull-transform and added:
>
> TSContCall(..., TS_EVENT_ERROR, ...);
>
> After the buffering had finished but before the call to
> TSVConnWrite(...).
>
> I then make a request via Traffic Server and I see:
>
> http_proxy=127.0.0.1:6045 curl -v www.airfix.com/us-en/
> * About to connect() to proxy 127.0.0.1 port 6045 (#0)
> * Trying 127.0.0.1... connected
> > GET HTTP://www.airfix.com/us-en/ HTTP/1.1
> > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0
> OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> > Host: www.airfix.com
> > Accept: */*
> > Proxy-Connection: Keep-Alive
> >
> < HTTP/1.1 500 INKApi Error
> < Date: Wed, 03 Jun 2015 17:51:22 GMT
> < Transfer-Encoding: chunked
> < Proxy-Connection: keep-alive
> < Server: ATS/5.1.2
> < X-Cache: MISS from death-cache
> < Content-Length: 0
> <
>
> After a long(-ish) wait curl will exit with:
>
> * transfer closed with outstanding read data remaining
> * Closing connection #0
>
> It seems a little odd that TS is sending both TE chunked and a
> content-length of 0 but it never actually sends any chunks not even an
> empty one. Am I doing something wrong?
>
> Thanks,
--
Michael Graham <mg...@bloxx.com>