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
Apache http client fix exception handling #417
Apache http client fix exception handling #417
Conversation
64e61af
to
020a168
Compare
* @see net.bytebuddy.matcher.HasSuperTypeMatcher | ||
*/ | ||
@HashCodeAndEqualsPlugin.Enhance | ||
public static class SafeHasSuperTypeMatcher<T extends TypeDescription> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you include in your comment how this is different from the SuperTypeMatcher
that is built into byte buddy?
Also describe how this is different from using failSafe(hasSuperType(...))
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be fixed now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better.
5b5a4dd
to
86af4fe
Compare
86af4fe
to
982d346
Compare
982d346
to
a4238aa
Compare
I tested this branch using the sample app @htmldoug provided in reference to #410 and it seems to solve the problem in a better way than what I did. I've fixed my pr #411 to revert the part that this PR fixes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! This and #411 should instrument Spring Boot!
*/ | ||
public static <T extends TypeDescription> ElementMatcher.Junction<T> safeHasSuperType( | ||
final ElementMatcher<? super TypeDescription> matcher) { | ||
// return hasSuperType(matcher); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(hold merge until after 0.2.12 release)
This makes sure no classes are loaded during instrumentation transformation which allows us to safely instrument depndent classes.
This allows ByteBuddy to properly find classes injected into the agent. Thanks @realark for providing a fix!
It should not be necessary after we jave fixed class location issue for ByteBuddy
Properly open and close outer span in multi-request cases
The idea is to just 'trim' type hierarchy 'up-trees' that we cannot resolve dring instrumentation instead of failing to instrument completely.
We not longer need it since our instrumentation can handle underlying loading problem.
`isSubType` may fail on certain class lookup problems, even on classes unrelated to given instrumentation, preventing instrumentation from being applied.
Newer ByteBuddy api simplifies things.
It looks like they fail tests from time to time
a4238aa
to
bb2126b
Compare
This should improve how 'hard' cases like redirects and errors are handled by apache http client instrumentation.