-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
In select_reactor.ipp, line 212, the outparam "ec" (error_code) of the socket_ops::select call is ignored.
If I understand the code correctly this can lead to a busy loop when one of the underlying sockets is damaged/invalid. We experienced high CPU usage in our application by one specific thread, especially when the process was idle for a long time or woke from hibernation. The callstack always lead to the select_reactor-Loop.
Some more information: our application makes a client connection to a partner process via async_connect. This internally opens three socket connections for the "self pipe trick" (to support cancellation of asynchronous connections). When I close one of the two "trick" sockets from outside (e. g. via TCPView) the thread wreaks havoc using up one core.
As far as I understand the "trick" sockets are only needed as long as the real connection is not established. If this is the case it would probably be better to clean them up when the connection is established.