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

fetchBatch在panic时没有释放锁 #24

Open
slowargo opened this issue Sep 10, 2024 · 0 comments
Open

fetchBatch在panic时没有释放锁 #24

slowargo opened this issue Sep 10, 2024 · 0 comments

Comments

@slowargo
Copy link

https://github.com/dtm-labs/rockscache/blob/main/batch.go#L44
defer func() { if r := recover(); r != nil { debug.PrintStack() } }()
当fn发生panic,这个地方虽然recover了,但没有释放锁,其他等锁的请求会被阻塞直到锁过期
另外这个debug.PrintStack()也不太友好,没办法把context里的额外信息打印出来,不好捞panic日志,是否可以考虑让业务方自己提供panic handler

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

1 participant