Skip to content

[Bug] When configuring condition route to route traffic to particular instance, there is still traffic in others #16130

@jk-tonycui

Description

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo 3.3.6, JDK 1.8

Steps to reproduce this issue

When configuring condition route to route traffic to particular instance, there is still traffic in others

What you expected to happen

The route config should be executed exactly. When configuration is set, traffic should follow the configuration to route traffic to the specified instance.

Anything else

After debugging, the root cause is the code below in AbstractStateRouter

routeResult = doRoute(invokers, url, invocation, needToPrintMessage, nodeHolder, messageHolder);
        if (routeResult != invokers) {
            routeResult = invokers.and(routeResult);
        }

invokers.and should only return the invokes that contains in both lists, but the implementation of and function is adding the tailList together. Therefore ,the final routeResults are redundant.

Do you have a (mini) reproduction demo?

  • Yes, I have a minimal reproduction demo to help resolve this issue more effectively!

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions