-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add IPv6 support to StatusServer and related classes. #119
base: master
Are you sure you want to change the base?
Conversation
Lint does not like variable named "p".
(for consistency with client code)
Just saw a new https://github.com/moodyjon/lbry-sdk/actions/runs/3911989925/jobs/6686050669 Converting this to draft status while investigating. |
Handle and retry EADDRINUSE errors.
This reverts commit 75d64f9.
I did some work on |
Have not seen |
# Because dualstack / IPv4 mapped address behavior on an IPv6 socket | ||
# differs based on system config, create the socket with IPV6_V6ONLY. | ||
# This disables the IPv4 mapped feature, so we don't need to consider | ||
# when an IPv6 socket may interfere with IPv4 binding / traffic. |
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.
If I don't disable IPv4 mapping, then the IPv6 port will sometimes seize (or try to seize) responsibility for IPv4. The bad effect is seen when starting the server with HOST=::,0.0.0.0
or HOST=0.0.0.0,::
. I forget which one fails, but 1 of these two orderings has persistent EADDRINUSE
errors.
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.
The bad ordering (on my machine) is HOST=::,0.0.0.0
:
2023-01-17 10:14:49,962 - hub.herald.udp - WARNING - started udp6 status server on ('::', 50002)
2023-01-17 10:14:49,963 - hub.herald.udp - ERROR - UDP status server failed to listen on (0.0.0.0:50002) : [Errno 48] Address already in use
2023-01-17 10:14:52,965 - hub.herald.udp - WARNING - started udp6 status server on ('::', 50002)
2023-01-17 10:14:52,966 - hub.herald.udp - ERROR - UDP status server failed to listen on (0.0.0.0:50002) : [Errno 48] Address already in use
HOST=0.0.0.0,::
works fine.
is only defined on IPv6 addrs.
Fixes #117
Update: Fixes #121
Not sure whether this is complete. I think I need help with this part in
hub/env.py
:If I allow the
cs_host()
to belocalhost
instead of 127.0.0.1, then it will start TCP servers on both v4/v6 sockets.What is the problem with docker and this behavior?