-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
ExtUvLoop: Fix reporting connection refused errors #207
Conversation
515c6d7
to
255aeaa
Compare
255aeaa
to
527c60a
Compare
The underlying `epoll_wait()` reports `EPOLLOUT|EPOLLERR|EPOLLHUP` on the affected file descriptor, which `ext-uv` emits as an error code `EBADF` with no events attached. We explicitly re-enable all active events on this error event to invoke the writable listener for this condition to match other event loop implementations and successfully detect this as a refused connection attempt. All tests are now green.
It works! 🎉 The underlying For future reference, here's how to install this extension in a sample Docker container and all the commands I've used to debug this issue: docker run -it -v /home/me/workspace:/workspace --workdir=workspace ubuntu:latest bash
apt update
apt-get install -y software-properties-common
add-apt-repository ppa:ondrej/php -y
apt-get install -y libuv1-dev php-pear php-dev strace
pecl install uv-beta
echo "extension=uv" >> "$(php -r 'echo php_ini_loaded_file();')"
php -m
cd /workspace
strace php examples/14-http-client-async.php
php -r 'var_dump((new ReflectionClass("UV"))->getConstants());'
vendor/bin/phpunit Now let's get this shipped! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
This PR fixes reporting "connection refused" on affected installation of ExtUvLoop. I have started with adding relevant tests to the test matrix, fixing the underlying issue and included additional tests to run run this on Windows as well.
Resolves #188
Builds on top of #205
Refs #206 to skip a similar problem for the
StreamSelectLoop
on Windows only.