Add IPv6 support to StatusServer and related classes.#119
Add IPv6 support to StatusServer and related classes.#119moodyjon wants to merge 8 commits intolbryio:masterfrom
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.
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.
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 belocalhostinstead 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?