Skip to content

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented Jan 5, 2022

Regression in 2.42.0 related to not correctly comparing subchannel addresses. The regression results in subchannels being recreated each time a resolver returns new addresses. Correct behavior is to recognize that a subchannel with an address already exists and continue to use it.

Note that most changes are related to logging. I noticed this when updating container example to use latest version and added more logging to help follow logic.

Should be backported to the 2.42.0 branch before the final version is released.

Comment on lines +96 to +99
if (!_disposed)
{
_socketConnectedTimer.Change(TimeSpan.Zero, TimeSpan.Zero);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guard against error if the transport is disconnected after it disposed.

{
var s = addressSubchannels[i];
if (Equals(s.Address, address))
if (Equals(s.Address.EndPoint, address.EndPoint))
Copy link
Member Author

@JamesNK JamesNK Jan 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compare the addresses endpoints to get subchannel reuse.

@JamesNK JamesNK merged commit 518a636 into grpc:master Jan 11, 2022
@JamesNK JamesNK deleted the jamesnk/load-balancing-compare-addresses branch January 11, 2022 02:25
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.

2 participants