Skip to content

[Bug] The traffic will be routed to instances of previous interface, which causes no such method error #16131

@jk-tonycui

Description

@jk-tonycui

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

Prepare two interfaces in different application, and invoke the interfaces one by one. The invocation of second interface will have no such method error.

What you expected to happen

The traffic should be always go to correct instances.

Anything else

After debugging, the issue is at the lines below in AbstractDirectory

/**
     * All invokers from registry
     */
    private volatile BitList<Invoker<T>> invokers = BitList.emptyList();

The invokes are initiated by BitList.emptyList(), and the emptyList() returns a variable of empty list. However, the invokers variable get the reference of emptyList, and changes happens in the first invocation of the first interface. When the second interface is invoked, the invokes are not empty, but the instances of the previous instances of the first interface.

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

    Labels

    help wantedEverything needs help from contributors

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions