Skip to content

grpc-js: Unregister socket from channelz when closing transport#2394

Merged
murgatroid99 merged 2 commits intogrpc:@grpc/grpc-js@1.8.xfrom
murgatroid99:grpc-js_transport_leak
Mar 23, 2023
Merged

grpc-js: Unregister socket from channelz when closing transport#2394
murgatroid99 merged 2 commits intogrpc:@grpc/grpc-js@1.8.xfrom
murgatroid99:grpc-js_transport_leak

Conversation

@murgatroid99
Copy link
Copy Markdown
Member

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.

@Matt-Esch
Copy link
Copy Markdown

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.

@murgatroid99
Copy link
Copy Markdown
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants