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

Fix issue with tablet_template_url in HealthCheck #3959

Merged

Conversation

rafael
Copy link
Member

@rafael rafael commented May 22, 2018

Description

Tests

  • Tested locally.

* Without this change, loadTabletUrl is only called during init method and it
won't have the flag parsed yet.

Signed-off-by: Rafael Chacon <[email protected]>
Copy link
Contributor

@michael-berlin michael-berlin left a comment

Choose a reason for hiding this comment

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

Makes sense :)

LGTM after my comment is addressed.

@@ -120,12 +120,11 @@ const (
)

func init() {
loadTabletURLTemplate()
LoadHealthCheckTabletURLTemplate()
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be removed then?

Instead, add a comment to the function "LoadHealthCheckTabletURLTemplate" that it should only be called after the flags are parsed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I left it intentionally because there was one template test that was failing without it. Fixing the test is straightforward, but I was worried that there might be a case out in the while where the template is used before LoadHealthCheckTabletURLTemplate is called. To be safe, I decided to leave the init.

Are you confident that is safe to remove?

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, scratch what I said earlier. I understand the problem now.

I suggest the following:

  • Rename the method to ParseTabletURLTemplateFromFlag.
  • Add here a comment: "Flags are not parsed at this point and the default value of the flag (just the hostname) will be used."
  • And a comment in the other file: "Flags are parsed now. Parse the template using the actual flag value and overwrite the current template."

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that makes. It will be clearer this way.

@michael-berlin michael-berlin merged commit d3ec17c into vitessio:master May 22, 2018
frouioui pushed a commit to planetscale/vitess that referenced this pull request Mar 26, 2024
…emove more errors from operator planning (vitessio#3959)

Signed-off-by: Andres Taylor <[email protected]>
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