Closed tamasd closed 4 years ago
@tamasd , I had submitted Mutex
operation, could you test it can works?
Closed, fixed in Release 1.2.1.
Sorry for the late answer. Unfortunately, I still get this issue with 1.2.1. I get data race errors from tests and invalid results.
groupcache/lru#Get needs to manipulate its list to track recently used item. So remove read-only
lock and used write
lock.
fixed in v1.2.2
My tests have passed, the bug looks fixed. Thanks!
I have an application that processes HTML files, heavily parallelized.
I often get panics because the LRU cache tries to add entries to a map at the same time. The offending line is this one: https://github.com/antchfx/htmlquery/blob/master/cache.go#L37
Guarding this with a mutex would solve my issue.