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
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
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 theReceiver
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
The text was updated successfully, but these errors were encountered: