- I have searched the issues of this repository and believe that this is not a duplicate.
Environment
- Dubbo version: 3.1.1
- Operating System version: linux
- Java version:1.8
Steps to reproduce this issue
- we use "offline" to shutdown dubbo app gracefully. when we offline more than two instances, it is possible for consumers to get the phenomenon.
reviewing the dubbo source code, we find that when offlining a instance it will remove services in "MetadataInfo" but
the field "revision of MetadataInfo" won't change in time. if a consumer requests metadatainfo from the offlining instance, it will response the metadatainfo without services.
Pls. provide [GitHub address] to reproduce this issue.
Expected Behavior
Actual Behavior
If there is an exception, please attach the exception trace:
Just put your stack trace here!
4条答案
按热度按时间wf82jlnq1#
Can you provide abnormal stack information? I also use offline commands for offline traffic and have not encountered this issue before. Version 3.1.0
mctunoxg2#
It is not an exception. There's no stack information. But I use Arthas to debug the consumer, and then find a cue as the following image. We can see that the filed "services" is a empty array.
The empty "services" cause the "urls 0" problem certainly.
pgpifvop3#
Please try update to 3.2.1.
qq24tv8q4#
I'm afraid it is not repaired in 3.2.1.
Step:
first: when we offline an instance, it unexports all the interfaces . what MetadataInfo to do is just remove serviceKey from the array services and mark the "revision" should be updated. but the field "revision" is not really changed. If a request for metadataInfo comes now, it will response the empty services. I think the method getRevision() of MetadataInfo should check whether the filed "updated" is true or not. if true, the method should not return a value. because of the revision can't represent the MetadataInfo now.