Repository navigation
Conversation
gibkim
marked this pull request as draft
September 30, 2026 06:04
gibkim
marked this pull request as ready for review
September 30, 2026 06:05
added 2 commits
October 27, 2026 10:04
RedefinitionLoggingListener was only registered with debug logging, so a failed retransformation batch was silent at the default level. Because every already-loaded class is retransformed in a single batch, one failure leaves all of them uninstrumented, as seen in DataDog#12540. Register the listener always, and log a one-line warning with the batch size and cause when debug logging is off. Debug logging keeps the full class list and stack trace.
RedefinitionLoggingListener is now registered on the main builder chain, so the debug block only needs TransformLoggingListener.
gibkim
force-pushed
the
gibkim/warn-on-retransform-failure
branch
from
October 27, 2026 01:09
0292dff to
db9ada7
Compare
Contributor
|
Hi @gibkim - thanks for the suggestion I am wary about changing this log message to WARN because we usually only produce warnings for things the user has control over. In this case there isn't enough actionable information for the user to solve the issue themselves, which means they would need to consult with us which would typically involve enabling debug mode anyway. We also have other changes in-flight for AOT which would make this logging change less useful. |
Author
|
Thanks for the explanation, that makes sense. I'll close this and keep an eye on the AOT changes. |
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.
What Does This Do
Registers
RedefinitionLoggingListenerat all log levels, not only when debug logging is on. When a retransformation batch fails and debug logging is off, it logs one warning with the batch size and the cause. Debug logging still logs the full class list and stack trace, as before.Motivation
In #12540 the whole instrumentation install was aborted and no spans were produced, but nothing was logged at the default level. The only hint was
Exception while retransforming 574 classeswith-Ddd.trace.debug=true. Because already-loaded classes are retransformed in a single batch, one failure leaves all of them uninstrumented.#12610 fixed that specific cause. This change makes any similar failure visible, so it can be found without debug logging.
Additional Notes
TransformLoggingListener.RedefinitionLoggingListenerForkedTestcovers the non-debug path. It is a forked test becauseAgentInstaller.DEBUGis fixed when the class is initialized. The test fails without the production change.AGENTS.md: this PR was written with an AI coding assistant (Claude Code) and reviewed by me. I ran the repo'stechdebtandperf-reviewskills on the diff:techdebtfound the redundant debug-block registration (fixed),perf-reviewfound nothing (install-time path only). I can't add labels as an external contributor, so could a maintainer addtag: ai generatedand thecomp:/type:labels?