alandekok/freeradius-server — pull request #51 by mattaezell (2012-03-08 01:35:36+00:00)
Title: V2.1.x Spare threads not exiting

It looks like the thread management isn't quite working like I expect it to. If I flood the server with a ton of concurrent requests, it will spawn new threads up to "max_servers". Then, if I slowly hit the server with requests (to allow the cleanup mechanism time to work), the number of threads does not go down to "max_spare_servers".

I instrumented threads.c, and it appears that a thread's "request" field doesn't get set to null after it handles a requests*. This is a problem, because the thread reaper uses the condition (handle->request == NULL) to mark a thread as THREAD_CANCELLED.