You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a chance to try the new shard PubSub adapter. Mostly works good, but when enable cleanupEmptyChildNamespaces, the close function will throw "CROSSSLOT Keys in request don't hash to the same slot". The root cause is redis/node-redis#2502
Currently,
close(){constchannels=[this.channel,this.responseChannel];if(this.opts.subscriptionMode==="dynamic"){this.rooms.forEach((_sids,room)=>{constisPublicRoom=!this.sids.has(room);if(isPublicRoom){channels.push(this.dynamicChannel(room));}});}// channels has at least 2 different strings, `sUnsubscribe` assumes // they would be hashed to the same slot which is not correct.returnthis.subClient.sUnsubscribe(channels);}
/** * Stop listening for messages posted to the given shard channels * - _group_: pubsub * - _complexity_: O(N) where N is the number of clients already subscribed to a shard channel. * - _since_: 7.0.0 */sunsubscribe(callback?: Callback<unknown>): Result<unknown,Context>;sunsubscribe(
...args: [
...shardchannels: (string|Buffer)[],callback: Callback<unknown>]): Result<unknown,Context>;sunsubscribe(
...args: [...shardchannels: (string|Buffer)[]]): Result<unknown,Context>;
Providing an array of channels to the SUNSUBSCRIBE command assumes all
the channels are allocated to the same slot, which is not always the
case, so we need to issue one command per channel.
Related: #500
I had a chance to try the new shard PubSub adapter. Mostly works good, but when enable
cleanupEmptyChildNamespaces
, theclose
function will throw "CROSSSLOT Keys in request don't hash to the same slot". The root cause is redis/node-redis#2502Currently,
A potential workaround
The text was updated successfully, but these errors were encountered: