Add clear_return_stacks default for coroutines modules. - #3011
Draft
sharvath-newrelic wants to merge 2 commits into
Draft
Add clear_return_stacks default for coroutines modules.#3011sharvath-newrelic wants to merge 2 commits into
sharvath-newrelic wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## change_kotlin_ignores #3011 +/- ##
===========================================================
- Coverage 70.88% 70.73% -0.15%
+ Complexity 10680 10674 -6
===========================================================
Files 874 880 +6
Lines 42997 43031 +34
Branches 6503 6507 +4
===========================================================
- Hits 30479 30439 -40
- Misses 9578 9651 +73
- Partials 2940 2941 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
This PR defaults
clear_return_stacks(the fix for AIOOBE when weaving Kotlin coroutine bytecode, e.g. Ktor'sinvokeSuspendcontinuations) to on for our Kotlin-coroutines/Ktor instrumentation modules (total of 8), so it applies automatically at runtime instead of requiring-Dnewrelic.config.class_transformer.clear_return_stacks=trueto be set manually.An explicitly-set system property (
trueorfalse) still overrides the per-module default in either direction, so existing behavior for anyone already using the global flag is unchanged. Every other instrumentation module keeps its current default (false).ClassWeaverServicematches each module's Implementation-Title against a hardcoded allow-list and setsclearReturnStacksDefaulton that module'sWeavePackageConfigat load time. That config is threaded throughClassWeave->MethodProcessors->MethodCallInlinerAdapter, so a future per-module default consumed at the same depth just needs a new getter onWeavePackageConfig.Related Github Issue
Resolves #2981
Testing
6 new tests have been added to attend to permutations on defaulting system properties.