internal WSGI server accept()'s connections even when no worker threads are available
Symptom: when a multitude of connections is made all at once, faster than the worker threads can process them, the internal server may run out of file descriptors and stop responding to requests altogether. This scenario may occur during an attack or simply during heavy use.
Cause: the web server accept()'s new connections in a loop (in tick()). New connections are then placed on the queue, where the worker threads can take them up. accept() runs even when no worker threads are available, thus eating up file descriptors.
The correct behavior would be not to run accept() until at least one worker thread is free.
Reported by firstname.lastname@example.org