Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc-js: Fix shutting down subchannels in separate pools #2103

Merged

Conversation

murgatroid99
Copy link
Member

This change makes the subchannel pool behave the same whether they are global or local. The main issue was that not calling subchannel.ref when creating the subchannel resulted in the subchannel shutting down but staying in the pool when its refcount reached 0, and then the pool could still use it. This is counter to the intention that a subchannel should only be shut down when it will never be used again. Once that is removed, the cleanup timer becomes useful to avoid filling the pool up with unused subchannels, and the result is that the global constructor parameter doesn't do anything anymore.

I also changed the subchannel shutdown behavior to transition to IDLE instead of TRANSIENT_FAILURE. In theory, both of those should be fine there because the important thing is closing and discarding the connection, but TRANSIENT_FAILURE is more disruptive if the shutdown is in error.

@murgatroid99 murgatroid99 merged commit 879d13b into grpc:@grpc/grpc-js@1.6.x Apr 20, 2022
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.

None yet

2 participants