Skip to content

fetchBatch在panic时没有释放锁 #24

Description

@slowargo

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions