-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Refactor] Chop too large hyperscan regex pattern when logging it on an error #52467
[Refactor] Chop too large hyperscan regex pattern when logging it on an error #52467
Conversation
…an error Signed-off-by: satanson <[email protected]>
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 3 / 3 (100.00%) file detail
|
error << "Invalid hyperscan expression: " << std::string(slice.data, slice.size) << ": " | ||
auto chopped_size = std::min<size_t>(slice.size, 64); | ||
auto ellipsis = (chopped_size < slice.size) ? "..." : ""; | ||
error << "Invalid hyperscan expression: " << std::string(slice.data, chopped_size) << ellipsis << ": " |
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.
error << "Invalid hyperscan expression: " << std::string(slice.data, chopped_size) << ellipsis << ": " | |
error << "Invalid hyperscan expression: " << std::string_view(slice.data, chopped_size) << ellipsis << ": " |
std::string_view might be lightweight in such case.
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.
it is a low-frequency executing code.
…an error (StarRocks#52467) Signed-off-by: satanson <[email protected]>
@Mergifyio backport branch-3.3 |
✅ Backports have been created
|
https://github.com/Mergifyio backport branch-3.2 |
✅ Backports have been created
|
https://github.com/Mergifyio backport branch-3.1 |
✅ Backports have been created
|
https://github.com/Mergifyio backport branch-3.0 |
…an error (#52467) Signed-off-by: satanson <[email protected]> (cherry picked from commit e95d0be)
https://github.com/Mergifyio backport branch-2.5 |
✅ Backports have been created
|
✅ Backports have been created
|
…an error (#52467) Signed-off-by: satanson <[email protected]> (cherry picked from commit e95d0be)
…an error (#52467) Signed-off-by: satanson <[email protected]> (cherry picked from commit e95d0be)
…an error (#52467) Signed-off-by: satanson <[email protected]> (cherry picked from commit e95d0be)
…an error (#52467) Signed-off-by: satanson <[email protected]> (cherry picked from commit e95d0be)
…an error (backport #52467) (#52526) Co-authored-by: satanson <[email protected]>
…an error (backport #52467) (#52524) Co-authored-by: satanson <[email protected]>
…an error (backport #52467) (#52525) Co-authored-by: satanson <[email protected]>
…an error (backport #52467) (#52528) Co-authored-by: satanson <[email protected]>
…an error (backport #52467) (#52527) Co-authored-by: satanson <[email protected]>
…an error (StarRocks#52467) Signed-off-by: satanson <[email protected]> Signed-off-by: zhiminr.ren <[email protected]>
Why I'm doing:
When hypercan patten exceeds some threshold(30KB+), hyperscan compilation report error and log the error, the size of be log would grow crazily.
What I'm doing:
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: