Skip to content

Adding previously completed topic to a ITopicEventSender throws exception - Websockets via InMemorySubscriptionProvider #2006

@Metevier

Description

@Metevier

Describe the bug
v10.4.3
Using subscriptions via the InMemorySubscriptionProvider, calling SubscribeAsync after callling CompleteAsync on a topic with the same key throws the following exception:

The semaphore has been disposed.
at System.Threading.SemaphoreSlim.CheckDispose()  at System.Threading.SemaphoreSlim.WaitAsync(Int32 millisecondsTimeout, CancellationToken cancellationToken)  at System.Threading.SemaphoreSlim.WaitAsync()   at HotChocolate.Subscriptions.InMemory.EventTopic`1.SubscribeAsync(CancellationToken cancellationToken)   at HotChocolate.Subscriptions.InMemory.InMemoryPubSub.SubscribeAsync[TTopic,TMessage](TTopic topic, CancellationToken cancellationToken)

To Reproduce
Steps to reproduce the behavior:

  1. Create a new InMemorySubscription using ITopicEventReceiver.SubscribeAsync
  2. Complete that subscription using ITopicEventSender.CompleteAsync using the same key as above.
  3. Try to create another subscription, using the same key and method as step 1.
  4. Exception thrown

Expected behavior
Can seamlessly create a new subscription using previously completed key.

Desktop (please complete the following information):

  • OS: Windows 10

Metadata

Metadata

Assignees

Labels

🔍 investigateIndicates that an issue or pull request needs more information.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions