![]() |
CherryPy Upload Timeout
Bah. Now this problem is really starting to piss me off. It has been an ongoing occurance for the last 5 to 6 months now.
Sometimes when a user tries to upload something on my site, it times out. Then the further you get away from my server, the less likely you are to time out. Since I am on the same network, it never does for me. People in Malaysia time out constantly. However! It works perfectly if I kill the server. Kill all the Python processes (yes, I don't know why there are other subprocesses still running...). Then restart the server. Then it works anywhere. I tried googling for other people having the same issue, I found one ticket that said the temporary file (used as an intermediate stage between the source and the destination), was never being closed. However, that ticket was in September, and I reinstalled CherryPy some time in February I believe. It's not necessary to post my code, because it is in no way different than what they tell you to use in the CherryPy documentation. Is this a problem with my Internet Service Provider? My internet connection? My CherryPy configuration? :
conf = dict()It is CherryPy 2.1.0 if I am not mistaken. |
Have you tried upgrading to the latest version (2.2.1 last I checked)?
Edit: Other than that, maybe: :
cherrypy.server.socket.settimeout(20) |
That sounded like a good idea, and it would work, but I get an attribute error. Server doesn't have the variable socket.
I'll try googling for how to set the timeout in CherryPy. There might be a better/different way. |
Even if the socket was accessable directly from the server, it's the listening socket, not the connecting one, so it would have no effect.
I've looked through the code, and in 2.1.0 at least, there is no timeout set on the connecting socket. Nor is any default timeout set in the CherryPy source, according to a quick grep I ran. So try putting this at the top of your code: :
import socketThis is assuming that the timeout takes place at the TCP layer, of course. |
I added that. I got someone from down in the US to upload something successfully. It worked. But of course, there are 340 files that have uploaded without a hinge previously. I'll have to wait to see if I get complaints to determine if this solved the problem. Thanks. :)
|
If it doesn't work, try setting timeout to 60. If it still doesn't work, then... well, in that case it's probably not a good solution :)
|
| All times are GMT -5. The time now is 12:55 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC