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

Query: Fix panic on stores endpoint #4754

Merged

Conversation

matej-g
Copy link
Collaborator

@matej-g matej-g commented Oct 8, 2021

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

As was reported in #4743, it is possible that if stores provided to querier are not available (e.g. the store is down, the address is incorrect etc.), trying to call the /stores endpoint can result in panic. This is due to the fact that the status of the endpoint is missing information on component type. The suggested way to resolve this is to ignore such stores.

Resolves #4743.

Verification

Added tests to verify /stores behaves as expected.

- Skip an endpoint from stores if component type is nil
- Simplify - pass only endpoint status func instead of endpoints

Signed-off-by: Matej Gera <matejgera@gmail.com>
Signed-off-by: Matej Gera <matejgera@gmail.com>
Signed-off-by: Matej Gera <matejgera@gmail.com>
yeya24
yeya24 previously approved these changes Oct 8, 2021
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

LGTM! Is it better to add this to the current release?

@matej-g
Copy link
Collaborator Author

matej-g commented Oct 11, 2021

LGTM! Is it better to add this to the current release?

I'd leave that to the maintainers' discretion, I can point this to the release as well if that's preferred.

For me, this is not that critical, since it requires a specific scenario with multiple unreachable / misconfigured stores. I think so far we've seen only one report of the issue.

squat
squat previously approved these changes Oct 11, 2021
Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

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

LGTM

…s-invalid-endpoint

Signed-off-by: Matej Gera <matejgera@gmail.com>
@matej-g matej-g dismissed stale reviews from squat and yeya24 via 6ab9b1e October 12, 2021 14:49
@yeya24 yeya24 enabled auto-merge (squash) October 13, 2021 05:30
@yeya24 yeya24 disabled auto-merge October 13, 2021 05:30
@yeya24 yeya24 merged commit d2b5bc0 into thanos-io:main Oct 13, 2021
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.

query: Panic when 2 thanos-query are connected?
3 participants