grpc-js: Unregister socket from channelz when closing transport#2394
Conversation
|
Does the grpc spec specify that the default configuration should be to enable this? I was fairly convinced something related to channelz was leaking when I reported the memory issues. I disabled it just to reduce the memory overhead of having it there anyway, I wonder if it would be best to make this an opt in feature? I also think the same about retries, unless I'm mistaken it looked as if I was opted into retries by upgrading the version. That change is a bit more problematic. |
|
The spec doesn't say anything about enabling or disabling data collection, but the corresponding channel option in the C core defaults to enabled. At this point, we can't change it because that would potentially break any code that is using it. And once the leak is fixed, I don't think it would be enough of an issue that we would want to do that anyway. The retry functionality that is enabled by default is transparent retries, which are specified that way. |
This fixes #2393. Manual testing shows that without this change, after a channel is closed, the channelz registry reference keeps the transport alive, and that in turn keeps the subchannel alive.