Skip to content

Receivers are not getting deleted when they go out of scope #44

@shsms

Description

@shsms

What happened?

Receivers are not getting destroyed as soon as they go out of scope, because channel implementations hold on to a reference to the Receivers, so that they can put new messages into them.

So when a the task that created a receiver dies, the receiver doesn't, but nobody is reading from it, and the logs get flooded with

Broadcast receiver [chan_name] is full. Oldest message was dropped.

What did you expect instead?

Receivers that go out of scope should get cleaned up.

Affected version(s)

No response

Affected part(s)

Channels, Broadcast, Bidirectional, etc. (part:channels)

Extra information

The solution appears to be to use a weakref to hold on to the receivers in the channel implementations.

And the send methods should check and cleanup any weakrefs to destroyed receivers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    part:channelsAffects channels implementationpriority:highAddress this as soon as possibletype:bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions