[PROF-12377] Update process context support with latest version of reference library #267
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.
What does this PR do?
This PR upgrades the process context support with the latest version of the latest library, taken from
https://github.com/DataDog/fullhost-code-hotspots-wip/tree/b33673d801b85a6c38fa0e9f1a139cb246737ce8/lang-exp/anonmapping-clib
Of interest, this version of the context support library:
otel_process_ctx_macos.cppon this sideOn the Java side, I:
ReentrantReadWriteLock, replacing it with asynchronized, as it's not safe to concurrently read and write the current context -- all access must be serialized.verifyMappingStructureas I thought it's a bit awkward to maintain if we need to change things until we stabilize the feature. Instead, I think for now it's simpler to assume the native reader is correct.Motivation:
Make sure Java is up-to-date with the latest improvements on the lib!
Also, since I had a lot of context on the latest changes, seems easier for me to shoot out a PR for this update.
Additional Notes:
I ran
./gradlew testbut I'm not sure the tests are running properly... Am I missing something?How to test the change?
I've updated the tests but at least with
./gradlew testthey don't seem to be running. Hopefully in CI it's all wired up?For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance.