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

populate empty resonse for IndexStatsResponse and VolumeResponse #11209

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Nov 10, 2023

Fixes a panic when the underlying response struct is accessed but not populated after an out-of-bounds request is short-circuited via NewEmptyResponse here. This PR ensures the embedded types are not nil in accordance with the other variants in this function.

@owen-d owen-d requested a review from a team as a code owner November 10, 2023 20:37
Copy link
Contributor

@jeschkies jeschkies left a comment

Choose a reason for hiding this comment

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

Nice one. Could you extend the tests?

@jeschkies jeschkies merged commit 265018b into grafana:main Nov 13, 2023
8 of 9 checks passed
@trevorwhitney trevorwhitney added type/bug Somehing is not working as expected backport k174 labels Nov 13, 2023
@grafanabot
Copy link
Collaborator

The backport to k174 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-11209-to-k174 origin/k174
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 265018b7293329241ffe9b7c56f38afb07b6b08f

When the conflicts are resolved, stage and commit the changes:

git add . && git cherry-pick --continue

If you have the GitHub CLI installed:

# Push the branch to GitHub:
git push --set-upstream origin backport-11209-to-k174
# Create the PR body template
PR_BODY=$(gh pr view 11209 --json body --template 'Backport 265018b7293329241ffe9b7c56f38afb07b6b08f from #11209{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[k174] populate empty resonse for IndexStatsResponse and VolumeResponse" --body-file - --label "size/S" --label "type/bug" --label "backport" --base k174 --milestone k174 --web

Or, if you don't have the GitHub CLI installed (we recommend you install it!):

# Push the branch to GitHub:
git push --set-upstream origin backport-11209-to-k174

# Create a pull request where the `base` branch is `k174` and the `compare`/`head` branch is `backport-11209-to-k174`.

# Remove the local backport branch
git switch main
git branch -D backport-11209-to-k174

trevorwhitney pushed a commit that referenced this pull request Nov 13, 2023
)

Fixes a panic when the underlying response struct is accessed but not
populated after an out-of-bounds request is short-circuited via
`NewEmptyResponse`
[here](https://github.com/grafana/loki/blob/main/pkg/querier/queryrange/limits.go#L155-L164).
This PR ensures the embedded types are not nil in accordance with the
other variants in this function.

(cherry picked from commit 265018b)
trevorwhitney added a commit that referenced this pull request Nov 13, 2023
…se (#11224)

Backport 265018b from #11209

---

Fixes a panic when the underlying response struct is accessed but not
populated after an out-of-bounds request is short-circuited via
`NewEmptyResponse`
[here](https://github.com/grafana/loki/blob/main/pkg/querier/queryrange/limits.go#L155-L164).
This PR ensures the embedded types are not nil in accordance with the
other variants in this function.

Co-authored-by: Owen Diehl <[email protected]>
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
…fana#11209)

Fixes a panic when the underlying response struct is accessed but not
populated after an out-of-bounds request is short-circuited via
`NewEmptyResponse`
[here](https://github.com/grafana/loki/blob/main/pkg/querier/queryrange/limits.go#L155-L164).
This PR ensures the embedded types are not nil in accordance with the
other variants in this function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants