Skip to content

Remove error from connectivity state tracking.#18628

Merged
markdroth merged 1 commit intogrpc:masterfrom
markdroth:remove_error_from_connectivity_state_tracker
Apr 15, 2019
Merged

Remove error from connectivity state tracking.#18628
markdroth merged 1 commit intogrpc:masterfrom
markdroth:remove_error_from_connectivity_state_tracker

Conversation

@markdroth
Copy link
Copy Markdown
Member

@markdroth markdroth commented Apr 3, 2019

It doesn't seem to add any benefit to track the error with the connectivity state, since we already report the same error for individual RPCs that fail while we are in state TRANSIENT_FAILURE. Removing this unnecessary complexity removes yet another internal API from the LB policy API.


This change is Reviewable

@markdroth markdroth added the release notes: no Indicates if PR should not be in release notes label Apr 3, 2019
@markdroth markdroth requested a review from AspirinSJL April 3, 2019 14:45
@markdroth markdroth requested a review from apolcyn as a code owner April 3, 2019 14:45
@markdroth markdroth force-pushed the remove_error_from_connectivity_state_tracker branch 2 times, most recently from 54597ce to 2e44fe0 Compare April 5, 2019 15:06
@markdroth markdroth force-pushed the remove_error_from_connectivity_state_tracker branch from 2e44fe0 to b315382 Compare April 5, 2019 15:45
Copy link
Copy Markdown
Contributor

@AspirinSJL AspirinSJL left a comment

Choose a reason for hiding this comment

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

Does this mean that we were actually not using this error before?

Reviewed 17 of 17 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @apolcyn and @markdroth)


src/core/ext/filters/client_channel/resolving_lb_policy.cc, line 124 at r1 (raw file):

  void UpdateState(grpc_connectivity_state state,
                   UniquePtr<SubchannelPicker> picker) override {
    if (parent_->resolver_ == nullptr) {

The bracket can be removed.

If the comment is kept, we still save one line.

Copy link
Copy Markdown
Member Author

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

It was never used for anything but human debugging. The main thing that changes in this PR is that we're no longer going to see the error message when the connectivity_state tracer is enabled. But since we will see the error message when the individual calls fail, I think that's okay.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @apolcyn)


src/core/ext/filters/client_channel/resolving_lb_policy.cc, line 124 at r1 (raw file):

Previously, AspirinSJL (Juanli Shen) wrote…

The bracket can be removed.

If the comment is kept, we still save one line.

It's generally considered a bad idea to have the body of an "if" statement be on its own line but not be surrounded by braces. This can lead to problems where a merge will incorrectly duplicate the body line with disasterous results, like the problem that Apple suffered in its SSL code a few years back:

https://embeddedgurus.com/barr-code/2014/03/apples-gotofail-ssl-security-bug-was-easily-preventable/

But I've changed it to fit the body on the same line with the condition, so this issue is moot.

Copy link
Copy Markdown
Contributor

@AspirinSJL AspirinSJL left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @apolcyn)


src/core/ext/filters/client_channel/resolving_lb_policy.cc, line 124 at r1 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

It's generally considered a bad idea to have the body of an "if" statement be on its own line but not be surrounded by braces. This can lead to problems where a merge will incorrectly duplicate the body line with disasterous results, like the problem that Apple suffered in its SSL code a few years back:

https://embeddedgurus.com/barr-code/2014/03/apples-gotofail-ssl-security-bug-was-easily-preventable/

But I've changed it to fit the body on the same line with the condition, so this issue is moot.

Yeah, in my hazy memory there is a story about merge like this. Thanks for the pointer!

@markdroth
Copy link
Copy Markdown
Member Author

Known failures: #16585 #18637 #17851

@markdroth markdroth force-pushed the remove_error_from_connectivity_state_tracker branch from 54f40a3 to 432c97e Compare April 15, 2019 20:14
@markdroth markdroth merged commit 63777c7 into grpc:master Apr 15, 2019
@markdroth markdroth deleted the remove_error_from_connectivity_state_tracker branch April 15, 2019 21:05
@lock lock bot locked as resolved and limited conversation to collaborators Jul 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants