Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Async Server should not hang on accept errors #172
I am evaluating cpp-netlib for a future webserver project with a lot of long polling calls and so far it is really cool.
For doing some stress tests I issued several 10000 concurrent calls on it. When the test server reaches its max file limit (ulimit -n) it just debugs
[DEBUG [path]/boost/network/protocol/http/server/async_server.hpp:120]: Error accepting connection, reason: system:24
Code 24 is too many files open.
And then hangs :(
The problem is not that the error happens (of course I could increase my file limit) but that the server immediately stops working, because it doesn't aync_accept any more connections (in async_server.hpp). Without enabling debug output the user doesn't even see this error.
The problem exists in current master (as looking into the source) and in 0.9.4.
I am not sure what the "right" reaction would be, but even crashing would be better than just doing nothing anymore. Another approach would be to add some callback by async_server so that the progammer can decide whats best.