Skip to content

Fix panic in SpanDeduper when traceID is empty slice#3668

Merged
mdisibio merged 2 commits intografana:mainfrom
mdisibio:spandeduper-empty-trace-panic
May 13, 2024
Merged

Fix panic in SpanDeduper when traceID is empty slice#3668
mdisibio merged 2 commits intografana:mainfrom
mdisibio:spandeduper-empty-trace-panic

Conversation

@mdisibio
Copy link
Copy Markdown
Contributor

@mdisibio mdisibio commented May 13, 2024

What this PR does:
SpanDeduper uses the last byte of the trace ID to shard into a submap of seen values. It didn't protect against an empty trace ID, which led to a panic.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@mdisibio mdisibio added backport r148 type/bug Something isn't working labels May 13, 2024
@github-actions
Copy link
Copy Markdown
Contributor

This PR must be merged before a backport PR will be created.

@github-actions
Copy link
Copy Markdown
Contributor

Hello @mdisibio!
Backport pull requests need to be either:

  • Pull requests which address bugs,
  • Urgent fixes which need product approval, in order to get merged,
  • Docs changes.

Please, if the current pull request addresses a bug fix, label it with the type/bug label.
If it already has the product approval, please add the product-approved label. For docs changes, please add the type/docs label.
If the pull request modifies CI behaviour, please add the type/ci label.
If none of the above applies, please consider removing the backport label and target the next major/minor release.
Thanks!

@mdisibio mdisibio merged commit d8c69d4 into grafana:main May 13, 2024
github-actions Bot pushed a commit that referenced this pull request May 13, 2024
* Fix panic in SpanDeduper when traceID is empty slice

* changelog

(cherry picked from commit d8c69d4)
mdisibio added a commit that referenced this pull request May 14, 2024
* Fix panic in SpanDeduper when traceID is empty slice

* changelog

(cherry picked from commit d8c69d4)

Co-authored-by: Martin Disibio <martin.disibio@grafana.com>
@github-actions
Copy link
Copy Markdown
Contributor

The backport to r147 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-3668-to-r147 origin/r147
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x d8c69d487eaa1f64af291793ef3b667c133342f0

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-3668-to-r147
# Create the PR body template
PR_BODY=$(gh pr view 3668 --json body --template 'Backport d8c69d487eaa1f64af291793ef3b667c133342f0 from #3668{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[r147] Fix panic in SpanDeduper when traceID is empty slice" --body-file - --label "type/bug" --label "backport" --base r147 --milestone r147 --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-3668-to-r147

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

# Remove the local backport branch
git switch main
git branch -D backport-3668-to-r147

mdisibio added a commit that referenced this pull request May 14, 2024
* Fix panic in SpanDeduper when traceID is empty slice

* changelog

(cherry picked from commit d8c69d4)
mdisibio added a commit that referenced this pull request May 14, 2024
* Fix panic in SpanDeduper when traceID is empty slice

* changelog

(cherry picked from commit d8c69d4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants