1
0
mirror of https://github.com/redis/go-redis.git synced 2025-12-03 18:31:14 +03:00

try to detect the deadlock x2

This commit is contained in:
Nedyalko Dyakov
2025-10-24 23:45:02 +03:00
parent c4ed467a59
commit 9ad62883ff
6 changed files with 69 additions and 9 deletions

View File

@@ -75,6 +75,11 @@ func (mp *mockPool) Remove(ctx context.Context, conn *pool.Conn, reason error) {
mp.removedConnections[conn.GetID()] = true
}
func (mp *mockPool) RemoveWithoutTurn(ctx context.Context, conn *pool.Conn, reason error) {
// For mock pool, same behavior as Remove since we don't have a turn-based queue
mp.Remove(ctx, conn, reason)
}
// WasRemoved safely checks if a connection was removed from the pool
func (mp *mockPool) WasRemoved(connID uint64) bool {
mp.mu.Lock()