Does anyone encountered the issue with NanoHttpd leaking threads?
The thing is the library creates a new thread for each incoming request and while I see response for those requests the internal thread that was running requests processing is never finished. That leads to that it has eventually several hundreds of leaked threads and app crash.
My code is pretty much basic and straightforward. I just sublclass NanoHTTPD and override serve() method.
I've debugged the lib itself and it loops in the following code forever in NanoHTTPD class:
while (!finalAccept.isClosed()) {
session.execute();
}
Any suggestions?
Update: Turned out that this is and edge case that is connected to the client app that makes requests to my app where http server is launched. When I make requests from Chrome or with curl it doesn't leak any threads.