Skip to content
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

CacheMessageListner可能会将当前节点缓存删除 #8

Open
bineanfrank opened this issue Jul 12, 2021 · 2 comments
Open

CacheMessageListner可能会将当前节点缓存删除 #8

bineanfrank opened this issue Jul 12, 2021 · 2 comments

Comments

@bineanfrank
Copy link

虽然测试中出现的概率几乎为0,但是处理的逻辑确实有可能出现这种情况:
在代码逻辑中:

push(new CacheMessage(this.name, key))
caffeineCache.put(key, value)

push(new CacheMessage(this.name, key))在CacheMessageListener的回调方法中,并没有过滤掉当前节点,可能会导致当前节点的本地caffeine缓存也删除,当然,这个情况可以说几乎不存在(因为走网络和走内存几乎是走内存快),但是更加严谨的做法,应该是处理消息时,避开当前节点

@lltx
Copy link
Contributor

lltx commented Jul 12, 2021

欢迎PR

@BrighterAmmo
Copy link

BrighterAmmo commented Apr 11, 2023

这是listener里面的serverId的判断的问题 message里面的serverId是Integer,manager里面的serverId是Long。类型不一致导致总是判断为false。全用Long就行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants