Support instrumentations that make structural changes and tolerate already-loaded target classes - #12610
Support instrumentations that make structural changes and tolerate already-loaded target classes#12610mcculls wants to merge 12 commits into
Conversation
…erate already-loaded target classes Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
This in turn revealed a gap in KafkaIastDeserializerTest when checking pass-through byte-buffers
Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ed class is not structurally changed
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 058842ae68
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Please try again by commenting @autotest review.
Summary
Instrumenter.WithStructuralChange, a marker interface for instrumentations whose type advice adds fields, methods, or interfaces to a target type. Each such instrumentation declares astructuralChangeMarker()interface that gets woven into the type when the structural change is applied.MatchRecorder.PreserveLoadedStructure, which narrows a match so an already-loaded class is only retransformed if it already declares the structural-change marker — avoidingVerifyError/redefinition failures from applying structural bytecode changes to classes the JVM has already loaded, while still allowing retransformation of classes that were already structurally changed pre-load.MatchRecorder.CopyMatchto reuse an already-computed match under another id instead of re-running the type matcher.Taintablevisitors,TaskUnwrappingInstrumentation, Vert.xRequestImplInstrumentation) onto the newWithStructuralChangepattern, removing the now-redundantTaintableRedefinitionStrategyListener,MrReturnAdvice, andLoadedTaintableClass.TaintableVisitor,UnwrappingVisitor, andRequestImplInstrumentation, extracting a sharedCollectionUtils.arrayContainshelper.TaintedMapbug where the last element wasn't deduplicatedENABLE_ADVICE_TRANSFORMERtest workaround, no longer needed now that structural-change retransformation is handled properly.PreserveLoadedStructureRetransformationForkedTestcovering: structural changes surviving retransformation, and an already-loaded (not structurally changed) class correctly not being retransformed.Test plan
PreserveLoadedStructureRetransformationForkedTestCollectionUtilsTestcovers the newarrayContainsutility🤖 Generated with Claude Code