-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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(tracing): trace hook error out when see nil #10364
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seems the failing test is related |
It is. But let's wait until the 3.2 released |
StarlightIbuki
force-pushed
the
fix/trace_throw_error
branch
from
February 28, 2023 07:46
0fe9317
to
2020022
Compare
StarlightIbuki
commented
Feb 28, 2023
StarlightIbuki
commented
Feb 28, 2023
fffonion
reviewed
Feb 28, 2023
fffonion
reviewed
Feb 28, 2023
Fix KAG-749 Co-authored-by: Wangchong Zhou <wangchong@konghq.com>
StarlightIbuki
force-pushed
the
fix/trace_throw_error
branch
from
February 28, 2023 09:36
de70cf9
to
ed3e1ae
Compare
I tried reverting the change and the test still fails for |
StarlightIbuki
added
the
pr/ready
This PR is considered ready and can be merged at anytime (given it received no subsequent changes)
label
Mar 8, 2023
ADD-SP
approved these changes
Mar 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
changelog
core/pdk
core/tracing
pr/ready
This PR is considered ready and can be merged at anytime (given it received no subsequent changes)
size/M
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
"instrument" hooks
toip
,db_connect
and other functions that widely used by core and plugins, and collect data for tracing.I surprisingly find the hooking function will error out when
set_attribute
got a nil value. For example, A failing DNS query would emit an error with traceback: "invalid value".This will definitely change the behavior of the hooked function.
toip
would have returned(nil, err)
if it's not hooked, but instead, it throws an error and the error has nothing to do with the origin error. This could cause more serious issues for other hooked functions.Luckily, we do not have more cases where
set_attributes
receives invalid values.The complete list of hooked functions will be shown offline.
Checklist
N/A There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE
Full changelog
Issue reference
KAG-749