Skip to content

Missing removeListener? #593

@svroonland

Description

@svroonland

I'm diagnosing an issue with a "dispatcher already shutdown" error message, using the 1.0.0 version of redis4cats. Here's the exception that is thrown:

Unexpected error occurred in RedisPubSubListener callback
java.lang.IllegalStateException: dispatcher already shutdown
	at cats.effect.std.Dispatcher$$anon$2.unsafeToFutureCancelable(Dispatcher.scala:283)
	at cats.effect.std.DispatcherPlatform.unsafeRunTimed(DispatcherPlatform.scala:60)
	at cats.effect.std.DispatcherPlatform.unsafeRunTimed$(DispatcherPlatform.scala:59)
	at cats.effect.std.Dispatcher$$anon$2.unsafeRunTimed(Dispatcher.scala:190)
	at cats.effect.std.DispatcherPlatform.unsafeRunSync(DispatcherPlatform.scala:52)
	at cats.effect.std.DispatcherPlatform.unsafeRunSync$(DispatcherPlatform.scala:51)
	at cats.effect.std.Dispatcher$$anon$2.unsafeRunSync(Dispatcher.scala:190)
	at dev.profunktor.redis4cats.pubsub.internals.PubSubInternals$$anon$1.message(PubSubInternals.scala:37)
	at io.lettuce.core.pubsub.PubSubEndpoint.notifyListeners(PubSubEndpoint.java:219)
	at io.lettuce.core.pubsub.PubSubEndpoint.notifyMessage(PubSubEndpoint.java:208)
	at io.lettuce.core.pubsub.PubSubCommandHandler.doNotifyMessage(PubSubCommandHandler.java:292)
	at io.lettuce.core.pubsub.PubSubCommandHandler.decode(PubSubCommandHandler.java:130)
	at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:598)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

Looking at PubSubInternals, I noticed there is a addListener call but there is no matching removeListener call anywhere. Could this be the cause, and should this be treated as a Resource?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions