Skip to content

Fix GH-23879: Do not report AcceptFailed on non-blocking accept timeout - #23880

Open
lazerg wants to merge 2 commits into
php:PHP-8.6from
lazerg:fix/gh-23879
Open

lazerg wants to merge 2 commits into
php:PHP-8.6from
lazerg:fix/gh-23879

Conversation

@lazerg

@lazerg lazerg commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

On a non-blocking listener, stream_socket_accept() with no client waiting went down the same path as a real failure and raised AcceptFailed ("Connection timed out"). That makes the usual "accept until empty" drain loop throw in StreamErrorMode::Exception, and the only way to tell it apart from something like fd exhaustion was the message text.

The TCP and TLS transports now treat a poll timeout or EAGAIN on a non-blocking listener as "nothing to accept" and return success without a client, so stream_socket_accept() returns false without reporting an error. Blocking listeners still report the timeout as before. PHP_TIMEOUT_ERROR_VALUE moved from network.c to php_network.h so the transports can check for it.

Fixes #23879

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant