Skip to content
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

NH-5044: Fix NPE issue unboxing null #20

Merged
merged 2 commits into from
Dec 7, 2021
Merged

Conversation

ghost
Copy link

@ghost ghost commented Dec 3, 2021

In AppOpticsProfilingSpanProcessor the metadata.getTraceID() is called and the returned id in Long type is used as the key of the Profiler. However, if the method above returns null it cannot be unboxed to the primitive type long and will throw an NullPointerException.

This PR changes the profiler map to use the hex string of the trace id as the key. The hex string trace id is converted from the byte array by calling metadata.getTaskID(), which always has a value when the metadata is valid.

See also https://github.com/librato/joboe/pull/1509

Lin-Lin_swi
Lin-Lin_swi mannequin approved these changes Dec 7, 2021
Copy link
Mannequin

@Lin-Lin_swi Lin-Lin_swi mannequin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @jiwen624!

Repository owner merged commit 44457f5 into main Dec 7, 2021
Repository owner deleted the NH-5044-npe-unboxing-null branch March 16, 2022 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants