![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programming Guru
![]() |
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()
conf['global'] = {
'server.socketPort': 80,
'logDebugInfoFilter.on': False,
'server.threadPool': 50,
'staticFilter.root': ''
}
...
cherrypy.config.update(conf)It is CherryPy 2.1.0 if I am not mistaken. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Have you tried upgrading to the latest version (2.2.1 last I checked)?
Edit: Other than that, maybe: cherrypy.server.socket.settimeout(20) |
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
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. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
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 socket socket.setdefaulttimeout(20) This is assuming that the timeout takes place at the TCP layer, of course. |
|
|
|
|
|
#5 |
|
Programming Guru
![]() |
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.
![]() |
|
|
|
|
|
#6 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
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
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CherryPy Multiple Threads | Sane | Python | 25 | Feb 20th, 2006 8:22 PM |
| CherryPy with py2exe | Sane | Python | 0 | Feb 5th, 2006 12:01 PM |
| winsock troubles w/ upload file | c0ldshadow | C++ | 2 | Feb 3rd, 2006 9:00 PM |
| Upload a file by getting the file form drive | bennyz12 | ASP | 1 | Jul 29th, 2005 8:46 PM |
| Help with the file upload control | Lipo | HTML / XHTML / CSS | 3 | May 2nd, 2005 11:32 AM |