Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PollSet::poll on Windows always returns immediately after first connection, due to bad event socket implementation #4594

Open
obiltschnig opened this issue Jun 26, 2024 · 1 comment

Comments

@obiltschnig
Copy link
Member

PollSet uses and event fd to interrupt an ongoing poll() in wakeUp(). On POSIX platforms this uses eventfd() and works fine. On Windows, a ServerSocket is created (either as Unix domain socket or TCP socket) instead. The problem is that when that event fd is signaled, the implementation attempts to receive from it. Which is not going to work as it's a ServerSocket. So this eventfd stays signaled forever, causing high CPU load as poll() always returns immediately.

@obiltschnig obiltschnig added this to the Release 1.13.4 milestone Jun 26, 2024
@obiltschnig obiltschnig self-assigned this Jun 26, 2024
obiltschnig added a commit that referenced this issue Jun 26, 2024
…after first connection, due to bad event socket implementation
obiltschnig added a commit that referenced this issue Jun 26, 2024
…after first connection, due to bad event socket implementation
@lanthora
Copy link
Contributor

The commit that fixes this problem should also solve the problem that the
Poco::Net::ServiceNotFoundException exception is thrown when creating a PollSet with a Chinese username in Windows.

// TemporaryFile path contains Chinese characters
_pSockFile.reset(new TemporaryFile);
// SocketAddress throw ServiceNotFoundException
_pSocket.reset(new ServerSocket(SocketAddress(_pSockFile->path())));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants