Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: dev

Issue 619 in cherokee: Cherokee + Tornado Redirects Broken

 

 

Cherokee dev RSS feed   Index | Next | Previous | View Threaded


codesite-noreply at google

Oct 21, 2009, 1:16 PM

Post #1 of 10 (677 views)
Permalink
Issue 619 in cherokee: Cherokee + Tornado Redirects Broken

Status: New
Owner: ----

New issue 619 by gavinmroy: Cherokee + Tornado Redirects Broken
http://code.google.com/p/cherokee/issues/detail?id=619

"Tornado is an open source version of the scalable, non-blocking web server
and tools that
power FriendFeed."

It was developed and primarily used against nginx. I am trying to use it
with Cherokee instead.

A sample nginx config is at
http://www.tornadoweb.org/documentation#running-tornado-in-
production

When sending a redirect to a client, Cherokee appears to be hanging and not
sending the
response to the browser *if* Keep-Alives between Cherokee and Tornado are
tuned on.

What steps will reproduce the problem?
1. Setup Cherokee with a Reverse Proxy handler pointing a Tornado based app
with Keep-Alvie
turned on, in both ends.
2. Navigate to the URL, result is there should be a HTTP Redirect

What is the expected output? What do you see instead?

The browser hanges until the back-end application closes the Keep-Alive
connection.

What version of the product are you using? On what operating system?

Cherokee 0.99.24, Linux (Gentoo)
Tornado 0.2

Please provide any additional information below.

Sample Tornado Code:

http://gist.github.com/215408

Sample Torndao Code with Keep Alive off:

http://gist.github.com/215411

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Oct 21, 2009, 1:20 PM

Post #2 of 10 (662 views)
Permalink
Issue 619 in cherokee: Cherokee + Tornado Redirects Broken [In reply to]

Comment #1 on issue 619 by gavinmroy: Cherokee + Tornado Redirects Broken
http://code.google.com/p/cherokee/issues/detail?id=619

Relevant Tornado code:

http://github.com/facebook/tornado/blob/master/tornado/web.py#L274
http://github.com/facebook/tornado/blob/master/tornado/web.py#L435

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Oct 21, 2009, 1:36 PM

Post #3 of 10 (654 views)
Permalink
Issue 619 in cherokee: Cherokee + Tornado Redirects Broken [In reply to]

Comment #2 on issue 619 by gavinmroy: Cherokee + Tornado Redirects Broken
http://code.google.com/p/cherokee/issues/detail?id=619

More clarification, it appears that it's internal redirects that cause
issues:

Example code:

{{{
import tornado.httpserver
import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
def get(self):
self.redirect('/redirect')

class RedirectHandler(tornado.web.RequestHandler):
def get(self):
self.write('It worked')

application = tornado.web.Application([
(r"/", MainHandler),
(r"/redirect", RedirectHandler)
])

if __name__ == "__main__":
http_server = tornado.httpserver.HTTPServer(application)
http_server.listen(8080)
tornado.ioloop.IOLoop.instance().start()
}}}

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Oct 21, 2009, 1:40 PM

Post #4 of 10 (646 views)
Permalink
Issue 619 in cherokee: Cherokee + Tornado Redirects Broken [In reply to]

Comment #3 on issue 619 by gavinmroy: Cherokee + Tornado Redirects Broken
http://code.google.com/p/cherokee/issues/detail?id=619

More clarification, it appears that it's internal redirects that cause
issues:

Example code:

<pre>
import tornado.httpserver
import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
def get(self):
self.redirect('/redirect')

class RedirectHandler(tornado.web.RequestHandler):
def get(self):
self.write('It worked')

application = tornado.web.Application([
(r"/", MainHandler),
(r"/redirect", RedirectHandler)
])

if __name__ == "__main__":
http_server = tornado.httpserver.HTTPServer(application)
http_server.listen(8080)
tornado.ioloop.IOLoop.instance().start()
</pre>

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Oct 21, 2009, 1:44 PM

Post #5 of 10 (658 views)
Permalink
Issue 619 in cherokee: Cherokee + Tornado Redirects Broken [In reply to]

Comment #4 on issue 619 by gavinmroy: Cherokee + Tornado Redirects Broken
http://code.google.com/p/cherokee/issues/detail?id=619

More clarification, it appears that it's internal redirects that cause
issues. It will basically hang and sometimes
hit the redirected url.

Example code:

import tornado.httpserver
import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
def get(self):
self.redirect('/redirect')

class RedirectHandler(tornado.web.RequestHandler):
def get(self):
self.write('It worked')

application = tornado.web.Application([
(r"/", MainHandler),
(r"/redirect", RedirectHandler)
])

if __name__ == "__main__":
http_server = tornado.httpserver.HTTPServer(application)
http_server.listen(8080)
tornado.ioloop.IOLoop.instance().start()

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Oct 21, 2009, 1:58 PM

Post #6 of 10 (656 views)
Permalink
Issue 619 in cherokee: Cherokee + Tornado Redirects Broken [In reply to]

Comment #5 on issue 619 by gavinmroy: Cherokee + Tornado Redirects Broken
http://code.google.com/p/cherokee/issues/detail?id=619

Here's a tcpdump showing the communication between Tornado and Cherokee.
Notice the 17 second delay
between the third packet and fourth.

tcpdump -i lo port 8080 -tt -A
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes
1256158625.124910 IP localhost.58619 > localhost.http-alt: P
294305852:294306533(681) ack 300934970
win 273 <nop,nop,timestamp 2205879072 2205871625>
E...).@.@..,...............<...:...........
.{. .z. GET / HTTP/1.1
Host: my
1256158625.125471 IP localhost.http-alt > localhost.58619: P 1:130(129) ack
681 win 289
<nop,nop,timestamp 2205879073 2205879072>
E...v.@.@..q...............:.......!.......
.{.!.{. HTTP/1.1 302 Found
Cont
1256158625.125508 IP localhost.58619 > localhost.http-alt: . ack 130 win
282 <nop,nop,timestamp
2205879073 2205879073>
E..4).@.@..................................
.{.!.{.!
1256158642.419921 IP localhost.58619 > localhost.http-alt: F 681:681(0) ack
130 win 282
<nop,nop,timestamp 2205896370 2205879073>
E..4).@.@...........................D/.....
.{N..{.!
1256158642.419998 IP localhost.http-alt > localhost.58619: F 130:130(0) ack
682 win 289
<nop,nop,timestamp 2205896370 2205896370>
E..4v.@.@..........................!.......
.{N..{N.
1256158642.420014 IP localhost.58619 > localhost.http-alt: . ack 131 win
282 <nop,nop,timestamp
2205896370 2205896370>
E..4).@.@..................................
.{N..{N.
1256158642.583315 IP localhost.58646 > localhost.http-alt: S
1056527515:1056527515(0) win 32792
<mss 16396,sackOK,timestamp 2205896534 0,nop,wscale 7>
E..<..@.@. .............>.T.........$.....@....
.{OV........
1256158642.583328 IP localhost.http-alt > localhost.58646: S
1058067862:1058067862(0) ack
1056527516 win 32768 <mss 16396,sackOK,timestamp 2205896534
2205896534,nop,wscale 7>
E..<..@.@.<.............?...>.T.....=.....@....
.{OV.{OV....
1256158642.583337 IP localhost.58646 > localhost.http-alt: . ack 1 win 257
<nop,nop,timestamp
2205896534 2205896534>
E..4..@.@. .............>.T.?.......%2.....
.{OV.{OV
1256158642.583374 IP localhost.58646 > localhost.http-alt: P 1:690(689) ack
1 win 257
<nop,nop,timestamp 2205896534 2205896534>
E.....@.@..B............>.T.?..............
.{OV.{OVGET /redirect HTTP/1.1

1256158642.583381 IP localhost.http-alt > localhost.58646: . ack 690 win
267 <nop,nop,timestamp
2205896534 2205896534>
E..4..@.@...............?...>.WM...."w.....
.{OV.{OV
1256158642.583793 IP localhost.http-alt > localhost.58646: P 1:165(164) ack
690 win 267
<nop,nop,timestamp 2205896534 2205896534>
E.....@.@..[............?...>.WM...........
.{OV.{OVHTTP/1.1 200 OK
Content
1256158642.583811 IP localhost.58646 > localhost.http-alt: . ack 165 win
265 <nop,nop,timestamp
2205896534 2205896534>
E..4..@.@. .............>.WM?..;... !......
.{OV.{OV


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Oct 21, 2009, 2:11 PM

Post #7 of 10 (649 views)
Permalink
Issue 619 in cherokee: Cherokee + Tornado Redirects Broken [In reply to]

Comment #6 on issue 619 by gavinmroy: Cherokee + Tornado Redirects Broken
http://code.google.com/p/cherokee/issues/detail?id=619

Another view of the data:

Cherokee -> Tornado (17:05:44.129535397):

GET / HTTP/1.1
Host: mynext.cd
Connection: Close
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; en-us)
AppleWebKit/531.9 (KHTML, like
Gecko) Version/4.0.3 Safari/531.9
Accept:
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Cookie: __utma=258234006.1408161053.1253543146.1256154421.1256157158.12;
__utmb=258234006.4.10.1256157158; __utmc=258234006;
__utmz=258234006.1253543146.1.1.utmcsr=(direct)|utmccn=(direct)|
utmcmd=(none);
_xsrf=dc61776ad4a844d89cce92eb15009a71
X-Forwarded-For: 68.64.144.211
X-Real-IP: 68.64.144.211
X-Forwarded-Host: mynext.cd

Tornado -> Cherokee (17:05:44.130521371):

HTTP/1.1 302 Found
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Location: http://mynext.cd/redirect
Server: TornadoServer/0.1

Cherokee -> Tornado (17:06:04.999547721):

GET /redirect HTTP/1.1
Host: mynext.cd
Connection: Close
Accept:
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip, deflate
Accept-Language: en-us
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; en-us)
AppleWebKit/531.9 (KHTML, like
Gecko) Version/4.0.3 Safari/531.9
Cookie: __utma=258234006.1408161053.1253543146.1256154421.1256157158.12;
__utmb=258234006.4.10.1256157158; __utmc=258234006;
__utmz=258234006.1253543146.1.1.utmcsr=(direct)|utmccn=(direct)|
utmcmd=(none);
_xsrf=dc61776ad4a844d89cce92eb15009a71
X-Forwarded-For: 68.64.144.211
X-Real-IP: 68.64.144.211
X-Forwarded-Host: mynext.cd

From Tornado to Cherokee (17:06:04.999547721):

HTTP/1.1 200 OK
Content-Length: 9
Etag: "46a0a49e667eb1a4e727ee2e24956b52202cb300"
Content-Type: text/html; charset=UTF-8
Server: TornadoServer/0.1

It worked

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Oct 23, 2009, 5:39 AM

Post #8 of 10 (650 views)
Permalink
Issue 619 in cherokee: Cherokee + Tornado Redirects Broken [In reply to]

Comment #7 on issue 619 by bkjones: Cherokee + Tornado Redirects Broken
http://code.google.com/p/cherokee/issues/detail?id=619

I used the code inside tornado provided by gavinmroy and put it behind
cherokee built
with tracing support :)

The output is below -- notice that the line where I wrote "STALL
==========" --
that's where the actual ~15 second stall happened, but the trace continues
after that
using time stamps that would indicate otherwise. :-/

I haven't had to sift through C code in some time, but my guess is that it
gets
interesting around handler_proxy.c:1383 noted below with the trace
message "Did not
get all, turning keepalive off".

Hope this helps.








Attachments:
trace.out 19.9 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Oct 31, 2009, 12:09 PM

Post #9 of 10 (626 views)
Permalink
Re: Issue 619 in cherokee: Cherokee + Tornado Redirects Broken [In reply to]

Updates:
Status: WaitingQA
Owner: alobbs
Labels: Type-Defect Priority-High OpSys-All Component-Logic

Comment #8 on issue 619 by alobbs: Cherokee + Tornado Redirects Broken
http://code.google.com/p/cherokee/issues/detail?id=619

It should be fixed in trunk:

http://svn.cherokee-project.com/changeset/3767

The fix will be shipped with Cherokee 0.99.27.
Reviews are more than welcome.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev


codesite-noreply at google

Nov 19, 2009, 4:00 AM

Post #10 of 10 (548 views)
Permalink
Re: Issue 619 in cherokee: Cherokee + Tornado Redirects Broken [In reply to]

Updates:
Status: Fixed

Comment #9 on issue 619 by alobbs: Cherokee + Tornado Redirects Broken
http://code.google.com/p/cherokee/issues/detail?id=619

I believe this issue was already fixed in 0.99.27.
Thanks for reporting and all the useful information you provided!

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
_______________________________________________
Cherokee-dev mailing list
Cherokee-dev [at] lists
http://lists.octality.com/listinfo/cherokee-dev

Cherokee dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.