-
-
Notifications
You must be signed in to change notification settings - Fork 465
Avoid NPEs from SDK in API like setTag, setData, setContext #4245
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
Conversation
Performance metrics 🚀
|
| for (final Span span : this.children) { | ||
| // This is used in the spanFinishCallback, when the span isn't finished, but has a finish | ||
| // date | ||
| if (!span.isFinished() && span.getFinishDate() == null) { | ||
| return false; |
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.
Seems unrelated, should we revert this change?
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.
Ah yes, forgot to revert this.
| if (key == null) { | ||
| return; | ||
| } |
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.
I think we need to also unset if value is null here, like we do in the other overloads
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.
Or maybe it will be handled by the below call? Not sure.
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.
Yeah, this is handled by Contexts.put so no need to duplicate it here.
lcian
left a comment
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.
LGTM
|
Flaky tests? Looks like the system tests are failing after ac9ebcd |
|
I'm guessing it's the OkHttp change. I've set the timeouts since it ran into |
📜 Description
Using the SDK and having to guard against
nullis not a nice experience. Instead the SDK now tries to do the right thing when it receivesnullon APIs likesetTag,setData,setContext,setExtraetc.This means the SDK will:
keyisnull(maybe returningnullif a return type is specified)null💡 Motivation and Context
Fixes #4224
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps