-
Notifications
You must be signed in to change notification settings - Fork 25
ENH: fix non-local client connection problem when server listen on 0.0.0.0 #92
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
Conversation
122d10b
to
4b93854
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #92 +/- ##
==========================================
- Coverage 88.97% 88.34% -0.64%
==========================================
Files 48 48
Lines 4038 4040 +2
Branches 770 771 +1
==========================================
- Hits 3593 3569 -24
- Misses 358 380 +22
- Partials 87 91 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
25ba65d
to
6b56c4c
Compare
2a4c035
to
2e4c193
Compare
It's xoscar's concept that When client init xoscar.actor_ref, server-side will return an ActorRef.address (which might redirect to another port). If server-side listen on zero ip, and client connect from a different host, the address 0.0.0.0:port returned by server is not address that can be reached. In this case we use client-side connect address to fix ActorRef.address
2e4c193
to
1ee70d1
Compare
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.
LGTM
Introduced from commit 5ffa0ea Author: Adam Ning <frostyplanet@gmail.com> Date: Wed Jul 10 15:24:08 2024 +0800 ENH: fix non-local client connection problem when server listen on 0.0.0.0 (xorbitsai#92)
Introduced from commit 5ffa0ea Author: Adam Ning <frostyplanet@gmail.com> Date: Wed Jul 10 15:24:08 2024 +0800 ENH: fix non-local client connection problem when server listen on 0.0.0.0 (xorbitsai#92)
Introduced from commit 5ffa0ea Author: Adam Ning <frostyplanet@gmail.com> Date: Wed Jul 10 15:24:08 2024 +0800 ENH: fix non-local client connection problem when server listen on 0.0.0.0 (xorbitsai#92)
Senario:
server(supervisor) listen on 0.0.0.0, might because it has multiple ip address, or the server hide behind L4 loadbalancer.
client (worker) connect server from another host (by ip or hostname) will cause such error.
The root cause is that xo.actor_ref() will return ActorRef(address=0.0.0.0) by server-side, although client originally specify server addr is not 0.0.0.0.
The next call to actor_ref will raise exception because 0.0.0.0 is treated as 127.0.0.1 by client-side.
We can split ActorRef.address into ip & port, detect zero address and replace with correct ip to fix the problem