This is not a strict Webware question, more of a Python and Linux
question, but I'm hoping someone may have some good insight into a fix.
I have a web app that relies on data from a 3rd party, fetched via XML
over HTTPS. I'm using urllib2 to connect to the remote server.
Unfortunately, the 3rd party is unstable, and when they have a problem,
sometimes the appserver crashes with this error:
Traceback (most recent call last):
File "WebKit/ThreadedAppServer.py", line 630, in run
File "WebKit/ThreadedAppServer.py", line 156, in mainloop
File "/usr/local/lib/python2.4/socket.py", line 169, in accept
error: (24, 'Too many open files')
I think this is a symptom of too many open connections to the 3rd party,
which makes sense since these server crashes (only happened twice so
far) are the same time as a reported "outage" by the 3rd party.
I already know about increasing the number of file descriptors for
Linux, which I did after the first occurance of this, but as I expected
that only delayed the problem. I need a way to recover from this somehow
without having the server crash.
Thanks for any advice!