issue-226350-newrelic
ByteBuddy annotation logic is too over agressive and it is impacting other agents like New Relic slowing down and failing start up.
Only classes that contain annotated methods we are interested in should be transformed.
This can be done with the following logic in ByteBuddyFactory
builder.type(ElementMatchers.declaresMethod( isAnnotatedWith(WrapInTransaction.class) .or(isAnnotatedWith(CloseDB.class)) .or(isAnnotatedWith(CloseDBIfOpened.class)) .or(isAnnotatedWith(LogTime.class)) ))
Note use env var DOTCMS_BYTEBUDDY_DEBUG=true to see the transformed classes as they transform and any errors. Only classes containing the annotations should now be attempted to load and new relic agent should show in log if added. Even without new relic agent startup should be slightly quicker and may fix some other issues as we are being more specific. I do not think it is an issue and probably same behavior as before byte buddy but worth noting that the annotations do not automatically propagate to subclasses on methods. This means that a method on a superclass that has one of these annotations will probably have issues unless the subclass method does not also have the annotation.
Unit Tests Report
1 318 tests ±0 1 308 :heavy_check_mark: ±0 3m 7s :stopwatch: +3s 127 suites ±0 10 :zzz: ±0 127 files ±0 0 :x: ±0
Results for commit 4241504f. ± Comparison against base commit 890b43be.
:recycle: This comment has been updated with latest results.
Integration Tests [postgres] Report
379 files ±0 379 suites ±0 59m 43s :stopwatch: - 1m 23s 3 694 tests ±0 3 671 :heavy_check_mark: ±0 23 :zzz: ±0 0 :x: ±0 3 713 runs ±0 3 690 :heavy_check_mark: ±0 23 :zzz: ±0 0 :x: ±0
Results for commit 4241504f. ± Comparison against base commit 890b43be.
:recycle: This comment has been updated with latest results.
Integration Tests [mssql] Report
378 files ±0 378 suites ±0 1h 16m 8s :stopwatch: - 2h 39m 11s 3 689 tests ±0 3 658 :heavy_check_mark: - 1 23 :zzz: ±0 8 :x: +1 3 708 runs ±0 3 677 :heavy_check_mark: - 1 23 :zzz: ±0 8 :x: +1
For more details on these failures, see this check.
Results for commit 4241504f. ± Comparison against base commit 890b43be.
:recycle: This comment has been updated with latest results.
Postman Tests Report
57 files ±0 1 071 suites ±0 2h 44m 28s :stopwatch: + 6m 22s 482 tests ±0 482 :heavy_check_mark: +1 0 :zzz: ±0 0 :x: - 1 1 792 runs ±0 1 792 :heavy_check_mark: +1 0 :zzz: ±0 0 :x: - 1
Results for commit 4241504f. ± Comparison against base commit 890b43be.
:recycle: This comment has been updated with latest results.