Async Server should not hang on accept errors #172

Closed
nob13 opened this Issue Nov 23, 2012 · 2 comments

Projects

None yet

2 participants

@nob13
nob13 commented Nov 23, 2012

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.

@deanberris
Member

Sorry this took a while. I would much prefer that this be fixed one way or another, and would welcome pull requests to fix this. Would you mind sending a pull request in to 0.9-devel so that this can be included in a 0.9.5 release?

@deanberris deanberris was assigned Jul 3, 2013
@deanberris
Member

I think this is worth addressing in a 0.10 release, and hopefully in 0.10.1 -- I'll take this on and see whether it can make it into 0.10.1.

@deanberris deanberris closed this Jul 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment