-
-
Notifications
You must be signed in to change notification settings - Fork 892
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
Fix address resolution on Solaris by specifying the protocol #2088
base: main
Are you sure you want to change the base?
Conversation
This fix should go to eventlet in the same way gevent was fixed. This package does not need to be concerned with the networking idiosyncrasies of all the different platforms. |
Well, I considered opening a PR for eventlet instead, and fixing their implementation of but it was not obvious to me how to fix it, unlike in the case of gevent. Note that gevent fixed the call to Eventlet simply implements an alternative to Python socket's So my thinking is that this is an invalid use of If you still disagree, do you have any idea how to fix this in eventlet? Or go straight to CPython? Note that if I set I would be grateful if you could reconsider or give me some further direction. |
If the Solaris port of CPython does not implement the correct behavior for this function then the bug is with the Solaris port. And if eventlet copied this code and duplicated the bug, the it is also a bug in eventlet.
This is not an invalid use of The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. As I said above, I don't want to maintain obscure hacks that are unrelated to this repository. If you need to start an eventlet server under Solaris, you can always use your own server starting code. Just copy the code from the |
I opened python/cpython#123832 with an explanation and a poc fix. Eventlet didn't copy the code directly, they just wrap Python code to make it async.
I don't write any server code myself, the bug was exposed by another tool that depends on Flask-SocketIO - specifically https://github.com/cs01/gdbgui. |
Hi @miguelgrinberg, the discussion with the CPython developers is now concluded, and the bottom line is that using The documentation has been updated to clarify this: https://docs.python.org/3.14/library/socket.html#socket.getaddrinfo The recommended usage example already included
... so it's actually a correctness fix rather than an obscure hack, but it's up to you to reject the PR anyway. |
Hi there,
Solaris supports address resolution only if no service name (port) is specified (
None
) or if a desired protocol is explicitly specified.Since you seem to support only TCP anyway, I suggest specifying the protocol explicitly, like in the Python documentation:
https://docs.python.org/3/library/socket.html#socket.getaddrinfo
It doesn't hurt on any platform and fixes the resolution on Solaris. Alternatively, you can just omit the service name from the resolution. This is how the Gevent people solved the same problem: gevent/gevent#1256 .