Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Runtime diagnostics for leaked messages in unbounded channels #12853

@dmitry-markin

Description

@dmitry-markin

Currently, there is no runtime warnings generated if some of unbounded channels are not polled and the messages keep accumulating and leak memory.

As suggested in https://github.com/paritytech/devops/issues/2085#issuecomment-1321726923 we should track the number of messages in flight in the channel when they are sent here and generate a runtime error if this number exceeds the threshold (one hundred thousand messages was suggested as a good number that should never be triggered under the normal circumstances).

When the error is triggered, it should print to the logs the relevant info about the Receiver that is not getting polled: the name of the Receiver and the the backtrace of where it was constructed.

This should help with investigating issues like https://github.com/paritytech/devops/issues/2085.

CC @koute @altonen

Metadata

Metadata

Assignees

Labels

I4-annoyanceThe client behaves within expectations, however this “expected behaviour” itself is at issue.U2-some_time_soonIssue is worth doing soon.Z1-easyCan be fixed primarily by duplicating and adapting code by an intermediate coder

Type

No type

Projects

Status

done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions