Skip to content
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

Closed
dmitry-markin opened this issue Dec 6, 2022 · 0 comments · Fixed by #12971
Closed

Runtime diagnostics for leaked messages in unbounded channels #12853

dmitry-markin opened this issue Dec 6, 2022 · 0 comments · Fixed by #12971
Assignees
Labels
I4-annoyance The client behaves within expectations, however this “expected behaviour” itself is at issue. U2-some_time_soon Issue is worth doing soon. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder

Comments

@dmitry-markin
Copy link
Contributor

dmitry-markin commented Dec 6, 2022

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

@dmitry-markin dmitry-markin added I4-annoyance The client behaves within expectations, however this “expected behaviour” itself is at issue. U2-some_time_soon Issue is worth doing soon. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder labels Dec 6, 2022
@dmitry-markin dmitry-markin self-assigned this Dec 6, 2022
@dmitry-markin dmitry-markin moved this to Backlog 🗒 in SDK Node Dec 6, 2022
@dmitry-markin dmitry-markin moved this from Backlog 🗒 to Code in review 🧐 in SDK Node Dec 21, 2022
Repository owner moved this from Code in review 🧐 to Done ✅ in SDK Node Dec 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I4-annoyance The client behaves within expectations, however this “expected behaviour” itself is at issue. U2-some_time_soon Issue is worth doing soon. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder
Projects
Status: done
Development

Successfully merging a pull request may close this issue.

1 participant