-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
GatewayApiMatcherManager BUG #2436
Conversation
Could you please sign the CLA here: https://cla-assistant.io/alibaba/Sentinel?pullRequest=2436 |
/** | ||
* @author Eric Zhao | ||
* @since 1.6.0 | ||
*/ | ||
public final class GatewayApiMatcherManager { | ||
|
||
private static final Map<String, WebExchangeApiMatcher> API_MATCHER_MAP = new ConcurrentHashMap<>(); | ||
private static Map<String, WebExchangeApiMatcher> API_MATCHER_MAP = new ConcurrentHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just volatile HashMap is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用volatile 会更好吗?
你这是出于什么考虑,而建议使用它呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConcurrentHashMap -> volatile HashMap
添加 volatile 修饰
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…re not removed (#2436) * Fix the bug that legacy API matchers in SC gateway adapter GatewayApiMatcherManager were not removed after the API group has been removed
Thanks for contributing! |
…re not removed (alibaba#2436) * Fix the bug that legacy API matchers in SC gateway adapter GatewayApiMatcherManager were not removed after the API group has been removed
Describe what this PR does / why we need it
网关流控API
当我添加一个API 定义之后,会同时更新GatewayApiMatcherManager
但是当我再将这个API 定义删除之后,也会更新GatewayApiMatcherManager,不过它只会添加不会删除。
Does this pull request fix one issue?
#2433
Describe how you did it
Describe how to verify it
Special notes for reviews