Actions
Bug #58671
closedFrontend socket leak that leads to OOM when connections are reset
% Done:
100%
Source:
Tags:
ssl beast backport_processed
Backport:
pacific quincy
Regression:
No
Severity:
2 - major
Reviewed:
Description
This issue is related to the following type of traffic:
- Client uses non-persistent connection (Connection: close).
- Client uses SO_LINGER option, which causes it to send RST when the socket is closed. The server side gets ECONNRESET.
- Client does HTTPS requests.
As the result, those sockets that got ECONNRESET would still go ahead to call async_shutdown() in the request coroutine because that error isn't propagated all the way up to the coroutine. After handle_connection() call, it thinks everything is OK so it calls async_shutdown() to shutdown SSL stream. However, the call to async_shutdown() never returns since epoll no longer delivers events on this socket after it delivered the one for ECONNRESET or when ECONNRESET is returned upon sendmsg(). So, the call is stuck and we have a socket/coroutine leak. Each coroutine consumes 512KB stack and eventually it will OOM and crash.
Actions