-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 panics when cloning a special query #8531
Conversation
sometimes we will get panics when parse the expression which is cloning a special query: `syntax error: unexpected $end, expecting NUMBER or { or (", line:1, col:1025}`. similar to grafana#7155 reported by DylanGuedes Signed-off-by: garrettlish <garrett.li.sh@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@garrettlish can you please explain why this change should fix the issue?
This breaks other tests btw: https://drone.grafana.net/grafana/loki/20419/3/5
I would appreciate if you could reduce those test cases down to more simple forms, which describe the actual problem at hand; these queries are complex and they will be difficult to interpret by future readers.
@dannykopping sorry for break other tests in the first commit. I add that complex query is because the syntax parse will panic for these kinds of complex queries only, looks like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The fix looks good, but I think we should address the underlying panic
as well.
I'll raise this with the team 👍
Hello @DylanGuedes!
Please, if the current pull request addresses a bug fix, label it with the |
Signed-off-by: garrettlish <garrett.li.sh@gmail.com> (cherry picked from commit 433d5bf)
What this PR does / why we need it:
Sometimes we will get panics when parse the expression which is cloning a special query:
syntax error: unexpected $end, expecting NUMBER or { or (", line:1, col:1025}
.Which issue(s) this PR fixes:
Fixes #7155
Special notes for your reviewer:
N/A
Checklist
CONTRIBUTING.md
guide (required)CHANGELOG.md
updateddocs/sources/upgrading/_index.md