BUG: Fix route problem when listen on 0.0.0.0 #101
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix route problem when both service listening 0.0.0.0:port calling each other
Two service listen on 0.0.0.0:1234, on different hosts:
xoscar.actor_ref(111.111.111.111:1234) will return unexpected LocalActorRef.
log print in context.actor_ref(111.111.111.111:1234)
using the returned LocalActorRef, method call intend for remote service actually sent to local service.
The solution is simple, during pool initialization, do not register_local_pool if address is all zero (because it's a widcast)
基于此前的改动 #92 发现了一个场景中的问题:
场景是两个服务,都 listen 0.0.0.0 但是在不同主机上同一个端口, 当写一个函数从 hostA.method 中去调用 hostB.method, 发现实际行为是 hostA.method 调用了 hostA.method,出现死循环。是由于从 hostA 去构建 actor_ref(hostB) 的时候返回了LocalActorRef。调查发现和 pool 初始化的行为有关。
解决办法是: 通配地址 0.0.0.0 不应该认为是本地地址,正常走 socket 通信就可以了.