Sentinel icon indicating copy to clipboard operation
Sentinel copied to clipboard

[BUG]ClusterNode Map clear problem.

Open ro9er opened this issue 7 years ago • 0 comments

Issue Description

bug report

Describe what happened (or what feature you want)

When I made CommonFilter support http method and test the function, I found the test case fail at: image After I have gone through the test code, I found the reason laid in here: image The code "ClusterBuilderSlot.getClusterNodeMap().clear()" clear all the cluster node in the global map of ClusterBuilderSlot class, but the specific cluster node hold by one ClusterBuilderSlot instance can not be clean. You can see the relationship here: image When the client try to access resource of the same name after clearing the cluster node map, the statistics can be accumulated but the node can not be added to the cluster node map any more because the cluster node is not null in the "IF" JUDGEMENT. So when get cluster node from map and assert is not null, that should fail.

Describe what you expected to happen

When the cluster node map got clean, the specific cluster node in one ClusterBuilderSlot should be clean either. One way to do this is add a volatile flag in cluster node to denote whether it should be clean or rebuild, and add the flag judge in ClusterBuilderSlot. However this makes cluster node more complex and hard to understand.

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

ro9er avatar Dec 07 '18 03:12 ro9er