Skip to content

Deadlock with subscribers #81

Description

@gusinacio

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status
    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions