When you subscribe to Iroh-docs events, you receive a Stream, and that stream is a wrapper around a bounded receiver with 256 limit.
The problem is that when it broadcast an event to all users, it's a blocking_send, so that means the actor eventloop won't process in case the channel is full.
I was able to create a deadlock, because I am fetching the Iroh doc using get_one.await, when I receive an event.
Usually, this is not a big issue, because it it goes to the channel, and later it can process my GetMany call.
But when the channel is busy sending multiple events to subscribers without processing any new commands, it gets in a state where my subscriber is awaiting for a command response, and it's blocked sending events to subscribers.
When you subscribe to Iroh-docs events, you receive a Stream, and that stream is a wrapper around a bounded receiver with 256 limit.
The problem is that when it broadcast an event to all users, it's a
blocking_send, so that means the actor eventloop won't process in case the channel is full.I was able to create a deadlock, because I am fetching the Iroh doc using get_one.await, when I receive an event.
Usually, this is not a big issue, because it it goes to the channel, and later it can process my GetMany call.
But when the channel is busy sending multiple events to subscribers without processing any new commands, it gets in a state where my subscriber is awaiting for a command response, and it's blocked sending events to subscribers.