There are a few places in the code where we use unbounded channels. This may lead to explosive memory usage if the receiver is slower than the senders. Making the channels bounded adds back pressure to the channels, which prevents exceeding a memory limit.
Bounded channels may lead to deadlocks if used in a circular manner. To help find these deadlock potentials, we should have a way to configure the bounds (e.g., during testing) to make the channels have the smallest bound possible.
Proposal
Investigate usages of unbounded channels and replace them with bounded channels.
Motivation
There are a few places in the code where we use unbounded channels. This may lead to explosive memory usage if the receiver is slower than the senders. Making the channels bounded adds back pressure to the channels, which prevents exceeding a memory limit.
Bounded channels may lead to deadlocks if used in a circular manner. To help find these deadlock potentials, we should have a way to configure the bounds (e.g., during testing) to make the channels have the smallest bound possible.
Proposal
Investigate usages of unbounded channels and replace them with bounded channels.