Skip to content

select_reactor::run ignores error_code #14

@Urmeli0815

Description

@Urmeli0815

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions