dapr / dapr/components-contrib
state/in-memory: Close() can deadlock with the cleanup goroutine
Open
- Dominant language
- Go
- Stars
- 602
- Forks
- 580
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 6
Description
Close() calls wg.Wait() while holding the write lock. The cleanup goroutine started by Init() needs that same lock in doCleanExpiredItems(), so if the cleanup ticker fires between Close() acquiring the lock and the goroutine reaching Lock(), the two wait on each other and Close() never returns — a permanent hang with no timeout or error. Reproduces reliably with concurrent Close() calls; details and a fix in the linked PR.
Contributor guide
Assessment
This issue has not been assessed yet.