go-redis
                                
                                 go-redis copied to clipboard
                                
                                    go-redis copied to clipboard
                            
                            
                            
                        Sentinel with PubSub deadlocks on Close
When using the FailoverClient (Sentinel) with PubSub, calling Close will deadlock.
Expected Behavior
Close will close the PubSub and return.
Current Behavior
Close does not return.
Steps to Reproduce
func main() {
	client := redis.NewFailoverClient(&redis.FailoverOptions{
		MasterName:    "...",
		SentinelAddrs: []string{"..."},
	})
	pubSub := client.Subscribe(context.Background())
	pubSub.Channel()
	time.Sleep(1 * time.Second)
	log.Println("Subscribed")
	pubSub.Close()
	log.Println("Closed")
}
Version: 9.5.1