dapr / dapr/components-contrib

state/in-memory: Close() can deadlock with the cleanup goroutine

Open
#4,495 3 comments 0 reactions 1 assignee Claimed by @karprabha View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.