benluteijn / cherokee

Automatically exported from code.google.com/p/cherokee
0 stars 1 forks source link

Fix timeout for handler when it takes more than timeout time to compute result #213

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compute a large result in handler_new
2. being timeout after first step

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

After the first step the timeout value should be updated. Thus the total
timeout for the server should be not absolute over the complete request,
but relative to the last time a transfer to the user was made.

Original issue reported on code.google.com by ste...@konink.de on 10 Nov 2008 at 4:57

GoogleCodeExporter commented 9 years ago
I cannot see what the bug is (or even whether it is actually a bug).
Is this related with the mechanism that a handler can use to increase a 
connection timeout limit?

Original comment by alobbs on 18 Nov 2008 at 12:29

GoogleCodeExporter commented 9 years ago
It is the issue where I did not yet implement your suggested hack. But my 
suggested
fix is to increase the timeout *always* after a packet successfully is 
transmitted to
the client.

Original comment by ste...@konink.de on 18 Nov 2008 at 3:27

GoogleCodeExporter commented 9 years ago
Which is, actually, what the server does. Otherwise you couldn't download large 
static files (the download of a 
DVD ISO image will last more than the timeout, doesn't it?).

Original comment by alobbs on 18 Nov 2008 at 5:33

GoogleCodeExporter commented 9 years ago
As I told you, I observed if _init takes too long, the only thing that is 
transfered
to the client is the first _step.

Original comment by ste...@konink.de on 18 Nov 2008 at 5:50

GoogleCodeExporter commented 9 years ago
This module shows the problem. Configure Cherokee with a timeout of 2s.

You will observe:
- the page loads for 10s, the sleep(10)
- the handler sends a ret_ok (to send the content)
- at that point the connection is ditched by cherokee

What is expected:
- cherokee kills the connection after 2 seconds (impossible because it would 
have to 
actually kill the _init function, which is not possible)

What would be good:
- cherokee updates the timeout after each _step so the page will be sent.

Original comment by ste...@konink.de on 5 May 2010 at 6:24

Attachments: