Skip to content
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

关于路由规则的一个问题优化 #118

Open
Cshiyuan opened this issue Jan 11, 2023 · 4 comments
Open

关于路由规则的一个问题优化 #118

Cshiyuan opened this issue Jan 11, 2023 · 4 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Cshiyuan
Copy link

1. 主要问题
当创建一个路由规则, 是类似于
{srcService: *, srcNamespace: *} -> {dstService: serivceA, dstNamespace: namespaceA}

表明对所有的主调方生效。

这个时候每个服务在拉取路由规则的时候,其中的outbound都会多一条:
{srcService: selfService, srcNamespace: selfNameSpace} - > {dstService: serivceA, dstNamespace: namespaceA}

当我调用一个服务,serviceB. 而这个serviceB不在outbound里面。
就会因为match不上而导致路由失败。

2. 可能导致问题的场景

我对一个服务创建了一个对所有主调生效的规则。
这个时候所有的服务srcService的outbound都会多一条规则。导致原本可以调用的服务不可调用了。

3. 可能的解决方式

当dstService没match到outbounds上,就走默认的路由规则。

@Cshiyuan Cshiyuan added the bug Something isn't working label Jan 11, 2023
@chuntaojun
Copy link
Member

"shiyuan:
「小骏:好的 我们优化下 javasdk已经是这样实现的 go还没有这样做 可以提个issue么?@shiyuan


javasdk是哪个版本fix的?还是一开始就这样实现的。"

@shiyuan 可以看看这里的代码:https://github.com/polarismesh/polaris-java/blob/main/polaris-plugins/polaris-plugins-router/router-rule/src/main/java/com/tencent/polaris/plugins/router/rule/RuleBasedRouter.java

@chuntaojun
Copy link
Member

这里主要是 polaris-go 客户端需要参考 java-sdk 版本进行优化实现

@chuntaojun chuntaojun added the good first issue Good for newcomers label Feb 1, 2023
@chuntaojun
Copy link
Member

chuntaojun commented Feb 3, 2023

we will fix in v1.4.0

@chuntaojun chuntaojun self-assigned this Feb 3, 2023
@chuntaojun
Copy link
Member

  • 匹配不到source,就走全路由
  • 匹配到source,没有destination的实例,就返回空列表

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants