[php-src] PR #13251: Fix EINPROGRESS very rarely occurring on synchronous php_network_connect_socket()
| From: | mauritsd | Date: | Fri, 26 Jan 2024 14:54:17 +0000 |
| Subject: | [php-src] PR #13251: Fix EINPROGRESS very rarely occurring on synchronous php_network_connect_socket() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-24899@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/13251
Author: mauritsd
php_network_connect_socket() in blocking mode does a select() to block on
a connect() call that reported EINPROGRESS. However, it then checks for
select() errors using getsockopt(..., SO_ERROR, ...), which will return
the earlier EINPROGRESS since it wasn't cleared by
php_socket_errno(). I believe this is the cause of https://github.com/phpredis/phpredis/issues/1881
and possibly other issues.
Note that, since the issue only happens very sporadically, I'm unable to write a test that
reproduces it, or to test that my fix works in practice. Also new to contributing to PHP, so
apologies in advance if I've done something wrong. :-)