-
-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I'm trying to debug an issue with my Redis PubSub where it's throwing a warning about "(RediStack) connection attempted to create a PubSub subscription".
I think what may be happening is that the PubSub code below pulls a connection out of the connection pool, but does not remove it from the pool. Meaning eventually that connection that is performing PubSub will get vended back out to some consumer, and because it has been placed in PubSub mode, will no longer be able to send.
redis/Sources/Redis/Application.Redis+PubSub.swift
Lines 8 to 27 in 50d6cea
| var pubsubClient: RedisClient { | |
| if let existing = self.application.storage[PubSubKey.self]?[self.id] { | |
| return existing | |
| } else { | |
| let lock = self.application.locks.lock(for: PubSubKey.self) | |
| lock.lock() | |
| defer { lock.unlock() } | |
| let pool = self.pool(for: self.eventLoop.next()) | |
| if let existingStorage = self.application.storage[PubSubKey.self] { | |
| var copy = existingStorage | |
| copy[self.id] = pool | |
| self.application.storage.set(PubSubKey.self, to: copy) | |
| } else { | |
| self.application.storage.set(PubSubKey.self, to: [self.id: pool]) | |
| } | |
| return pool | |
| } | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working