Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing RUnlock's to m3aggregator locking code (#3446)
These were missed in https://github.com/m3db/m3/pull/3315/files, and were causing hangs for us in prod. Suspected sequence leading to hangs: - RLock() - Missed unlock on shard not owned `if int(shardID) >= len(agg.shards) return errShardNotOwned` - Lock() from placement change (will never succeed) - RLock() -- hangs all subsequent times due to pending Lock() Once threads start hitting the final RLock, the aggregator locks up and stops processing metrics. RWMutex behavior is consistent with the docs: ``` // If a goroutine holds a RWMutex for reading and another goroutine might // call Lock, no goroutine should expect to be able to acquire a read lock // until the initial read lock is released. ``` https://gist.github.com/andrewmains12/fabc257f4552f8e778828a23346d71c3 has a rough reproduction of the above locking sequence.
- Loading branch information