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

hi,请问关于lru的panic issue,你是如何稳定复现的?我看代码,以及写并发demo都没有复现 #9

Open
liuc144 opened this issue Jan 3, 2023 · 11 comments

Comments

@liuc144
Copy link

liuc144 commented Jan 3, 2023

golang/groupcache#163

@liuc144 liuc144 changed the title hi,请问关于lru的panic issue hi,请问关于lru的panic issue,你是如何稳定复现的?我看代码,以及写并发demo都没有复现 Jan 3, 2023
@liuc144
Copy link
Author

liuc144 commented Jan 3, 2023

有联系方式可以沟通么,我遇到了同样的问题,但无法复现,外层去掉锁会触发map的并发读写panic,加上锁,按照你issue提出的代码也无法复现

@liyan-ah
Copy link
Owner

liyan-ah commented Jan 3, 2023

有联系方式可以沟通么,我遇到了同样的问题,但无法复现,外层去掉锁会触发map的并发读写panic,加上锁,按照你issue提出的代码也无法复现

issue 里的代码只是个简单的示例。实际的业务逻辑里涉及到大量的指针、结构体、并发操作。我能提供的建议是换个缓存。

@liuc144
Copy link
Author

liuc144 commented Jan 3, 2023

我也明白换个缓存就行了,但是搞技术的就想明白,那个node的val怎么就是个nil呢

@liuc144
Copy link
Author

liuc144 commented Jan 3, 2023

free cache嘛,很多组件都能用

@liuc144
Copy link
Author

liuc144 commented Jan 3, 2023

我们实际的业务逻辑也比较复杂,但抽离来看,也是你demo里演示的样子。就是lru加个锁

@liuc144
Copy link
Author

liuc144 commented Jan 3, 2023

怎么搞都复现不了

@liyan-ah
Copy link
Owner

liyan-ah commented Jan 3, 2023

怎么搞都复现不了

替换的成本高么,不高的话就换掉吧,还是先确保能够跑起来。

@liuc144
Copy link
Author

liuc144 commented Jan 3, 2023

还好吧,解决的办法我们都是懂得。但是没办法复现很难堪啊大佬

@liuc144
Copy link
Author

liuc144 commented Jan 3, 2023

如果大佬已经忘记当时的场景了那就没辙了,找了半天只有你明确提出了能复现和复现的方法。哎

@liyan-ah
Copy link
Owner

liyan-ah commented Jan 3, 2023

如果大佬已经忘记当时的场景了那就没辙了,找了半天只有你明确提出了能复现和复现的方法。哎

就当作已知问题处理吧。我这里也只是在业务代码里出现了。简单的 demo 也复现不了。

@liuc144
Copy link
Author

liuc144 commented Jan 3, 2023

太糟糕了,简单的demo复现不了,很难说服周围人,做一件事的原理是什么,这种感觉太差

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

2 participants