Skip to content
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

Avoid need to inject BeanDefinitionRepairer everywhere as a helper #5365

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

mcculls
Copy link
Contributor

@mcculls mcculls commented Jun 12, 2023

Instead we record the bean classes of the initial definitions as they are registered, so we can repair them as necessary later on. This also means we can remove the extra call to 'setBeanClassName' which was overwriting the resolved class in the definition (they share a single field) and was actually making the original issue more likely.

This approach works better in OSGi where otherwise we might end up injecting multiple BeanDefinitionRepairer helpers, which increases the risk of a type being registered in a repairer class that's different to the one actually used to repair definitions.

@mcculls mcculls added inst: others All other instrumentations inst: spring Spring instrumentation labels Jun 12, 2023
@pr-commenter
Copy link

pr-commenter bot commented Jun 12, 2023

Benchmarks

Parameters

Baseline Candidate
commit 1.16.0-SNAPSHOT~d1678e8198 1.16.0-SNAPSHOT~05a952acf9
config baseline candidate
See matching parameters
Baseline Candidate
module Agent Agent
parent None None

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 22 cases.

@mcculls mcculls marked this pull request as ready for review June 12, 2023 11:06
@mcculls mcculls requested a review from a team as a code owner June 12, 2023 11:06
@mcculls mcculls requested a review from amarziali June 15, 2023 08:56
Copy link
Collaborator

@amarziali amarziali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense. thanks for the PR

mcculls and others added 2 commits June 16, 2023 11:37
Instead we record the bean classes of the initial definitions as they are registered,
so we can repair them as necessary later on. This also means we can remove the extra
call to 'setBeanClassName' which was overwriting the resolved class in the definition
(they share a single field) and was actually making the original issue more likely.

This approach works better in OSGi where otherwise we might end up injecting multiple
BeanDefinitionRepairer helpers, which increases the risk of a type being registered in
a repairer class that's different to the one actually used to repair definitions.
@mcculls mcculls force-pushed the mcculls/cleanup-bean-repairer-injection branch from f4ee88c to 05a952a Compare June 16, 2023 10:41
@mcculls mcculls merged commit e73ec2a into master Jun 19, 2023
@mcculls mcculls deleted the mcculls/cleanup-bean-repairer-injection branch June 19, 2023 19:28
@github-actions github-actions bot added this to the 1.17.0 milestone Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: others All other instrumentations inst: spring Spring instrumentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants