redis / rueidis

A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, etc.
Apache License 2.0
2.34k stars 149 forks source link

Fix rueidislock highload #604

Closed rueian closed 1 month ago

rueian commented 1 month ago

Closes #602

This PR keeps using the same event watcher of client-side caching during the retries of rueidislock.WithContext and watches the event for retrying.

Previously, there was a race that could lead to the removal of the watcher thus causing busy retries and missing events.