Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only store channel if use_cached_channel is true (#387)
The gRPC client exposes a parameter that disables reusing a cached channel: use_cached_channel. Setting this to false doesn't stop the channel (and mock) from being inserted to the internal channel cache. The problem with it being inserted to the map means the channel will only get destroyed once it's being replaced by another channel. In our case we want the channel (and associated connection) to be closed as soon as the client using it is getting destroyed though, meaning we don't want to reuse the channel at all. I believe this is also consistent with the description for use_cached_channel: If false, a new channel is created for each new client instance. When true, re-use old channels from cache for new client instances. The default value is true
- Loading branch information