Commit Graph

3669 Commits

Author SHA1 Message Date
Lev Priima 5265a43c6d Reduce use of Thread::setContextClassLoader 2020-02-06 22:53:04 -05:00
Cecile terpin 0e86cf6312
Merge pull request #1202 from DataDog/cecile/setError
Cecile/set error
2020-02-06 17:47:21 +01:00
Cécile Terpin 25ddcd434b Merge branch 'master' into cecile/setError 2020-02-06 17:03:33 +01:00
Cécile Terpin d095978223 Fix setError 2020-02-06 17:02:17 +01:00
Tyler Benson 14b5576cd8
Merge pull request #1201 from DataDog/tyler/upgrade-okhttp
Upgrade OkHttp client to 3.12.8
2020-02-04 15:55:36 -08:00
Tyler Benson cab139e905 Upgrade OkHttp client to 3.12.8 2020-02-04 15:06:44 -08:00
Laplie Anderson a811c027ce
Merge pull request #1188 from DataDog/landerson/finatra
Finatra Instrumentation
2020-02-04 17:36:47 -05:00
Tyler Benson 0eac80baa0
Remove Jackson from dd-trace-ot (#1185)
Remove Jackson from dd-trace-ot
2020-02-03 15:10:16 -05:00
Tyler Benson 697d4972a8 Remove Jackson from dd-trace-ot
Reduced the size of dd-java-agent jar by about 2 MB. Jackson is not removed completely though as it is still a dependency of jmxfetch.

Trace serialization is primarily done directly with msgpack.
Response deserialization and LoggingWriter serialization is done with mochi.

Msgpack Serialization buffer still not being reused though.
2020-01-31 15:59:43 -05:00
Tyler Benson 406b324a82
Split TraceConsumer into two different disruptors (#1161)
Split TraceConsumer into two different disruptors
2020-01-31 15:41:14 -05:00
Brian Devins-Suresh 6ae4ab3880 Begin 0.43.0 2020-01-31 15:19:38 -05:00
Brian Devins-Suresh f78b34fd9d Version 0.42.0 2020-01-31 14:33:50 -05:00
Brian Devins-Suresh 848476316d
Merge pull request #1196 from DataDog/tyler/fix-span-attribute
Set dispatcher span on request instead of clear
2020-01-31 13:26:33 -05:00
Tyler Benson daae198b08 Set dispatcher span on request instead of clear
Clearing the span caused traces to be broken up and reported independently when calling forward/include.
2020-01-30 21:55:16 -05:00
Douglas Q Hawkins 53d32b4324
Merge pull request #1189 from DataDog/dougqh/type-caching2
Revised type cache
2020-01-30 18:47:02 -05:00
Laplie Anderson ed12af6994 Assume parent span is netty 2020-01-30 18:21:49 -05:00
dougqh faeb069424 Adjusting capacity check again 2020-01-30 18:08:49 -05:00
dougqh 235a6470fb googleJavaFormat 2020-01-30 17:45:40 -05:00
dougqh 0f095f0adb Final clean-up
- Removed unused method from earlier version
- Corrected previously overlooked comments that were remnant of prior version
2020-01-30 17:44:24 -05:00
Laplie Anderson 37a279069b Add server tests 2020-01-30 15:23:26 -05:00
Tyler Benson 8757ba0a81
Fix potential StackOverFlowError on regexp (#1193)
Fix potential StackOverFlowError on regexp
2020-01-29 13:19:40 -05:00
Blinkingor 8d83172128 clazz -> segment rename 2020-01-29 18:41:29 +01:00
Blinkingor db485d10da final configString 2020-01-28 16:20:02 +01:00
Blinkingor 811051d111 Remove overlapping tests and fix failing unit test 2020-01-28 16:06:23 +01:00
Blinkingor 10b963d277 Codenarc fixes 2020-01-28 15:35:39 +01:00
Blinkingor cf876b5e67 Fix import order 2020-01-28 15:21:50 +01:00
Blinkingor 1e390984c1 Fix potential StackOverFlowError on regexp 2020-01-28 10:28:37 +01:00
dougqh 176f826a44 Adjusting approximateSize check to be more reliable 2020-01-27 17:44:39 -05:00
dougqh 4c7a0ba7a7 Fixing muzzle?
MuzzlePlugin groovy checks that no threads are spawned because this holds the ClassLoader live.

This was breaking with the caching change because the cache no longer uses the Cleaner service.

This caused a problem because the Thread behind the cleaner is created lazily when the first task is created, but without the cache the creation was delayed.

To solve this, I addressed the original cause of the leak.  The newly created Thread automatically inherits the contextClassLoader of its parent, but that's unnecessary for a cleaner thread.

So I changed the ThreadFactory for cleaner to explicitly null out the contextClassLoader.

We should probably null out contextClassLoader in other thread factories and also reduce our use of contextClassLoaders in general, but that will left to another PR.
2020-01-27 17:14:17 -05:00
dougqh d50f901f39 googleJavaFormat, codeNarcTest, and test reliability 2020-01-27 12:34:39 -05:00
dougqh fb871611b5 Replacing ID generation with WeakReference reuse
First pass at replacing ID generation with WeakReference reuse

In this first version, the Cache<ClassLoader, ID> was replaced with Cache<ClassLoader, WeakReference<ClassLoader>>.

The core cache is still of Cache<TypeCacheKey, TypePool.Resolution> and TypeCacheKey logically remains a composite key of ClassLoader, class name.

The removal of ID assignment means ID exhaustion is no longer na issue, so there's never a need to rebuild the cache.  For that reason, CacheInstance has removed and the core caching logic has been moved into DDCachingPoolStrategy.

While TypeCacheKey remains conceptually the same, the internals have changed somewhat.  The TypeCacheKey now has 3 core fields...
- loaderHash
- loadeRef
- class name

Since loader refs are recycled, the fast path for key equivalence can use reference equivalence of the reference objects.

This change ripples through the CacheProvider-s which also have to store loaderHash and loaderRef.

It may be worth going a step further and switching to a Cache<Loader, TypePool> as well.  That still avoid the creation of many WeakReference-s, since the underlying CacheProvider will hold a canonical WeakReference per ClassLoader.
2020-01-27 12:03:44 -05:00
dougqh cf877f67e5 Working around muzzle quirk
Muzzle doesn't like creation of SecureClassLoader-s, so switching to a URLClassLoader for my placeholder loader in tests
2020-01-27 09:47:36 -05:00
Brian Devins-Suresh 660041636a
Merge pull request #1190 from DataDog/devinsba/hibernate-null-entity-check
Add null check to hibernate decorator
2020-01-24 14:55:11 -05:00
Brian Devins-Suresh 3daad0009d Add null check to hibernate decorator 2020-01-24 10:58:52 -05:00
Laplie Anderson 8ff985afdb Cleaner way to skip netty executor's tasks 2020-01-23 12:04:56 -05:00
dougqh 984d77e44c googleJavaFormat & codeNarc 2020-01-23 11:15:39 -05:00
dougqh 726236bd64 Type cache overhaul
This change overhauls the core type cache

The new approach aims to achieve several things...
1 - cache is strictly bounded -- no variance for number of classes of ClassLoaders
2 - cache is significantly smaller
3 - cache doesn't compromise start-up time
4 - primary eviction policy isn't driven by time
5 - primary eviction policy isn't driven by GC

There are some slight compromises here.
In practice, start-up does increase slightly in a memory rich environment; however, start-up improves considerably in a memory poor environment.

The basic approcach is to have a single unified Guava cache for all ClassLoaders -- nominally keyed a composite of ClassLoader & class name

The ByteBuddy CacheProvider are simply thin wrappers around the Guava cache associated to a particular ClassLoader

However rather than having a large number of WeakReferences floating around.  The cache assigns an ID to each ClassLoader.

To further avoid, consuming memory the cache only preserves a small map of Loader / ID assignments.  This means a ClassLoader may have more than one active ID.

This introduce the possibility for ID exhaustion.  That unlikely case is handle by retiring the internal CacheInstance and starting anew.
2020-01-23 10:55:16 -05:00
Laplie Anderson 68e52497d6 Move to versioned folder name 2020-01-23 10:51:38 -05:00
dougqh 17af9b752c Fix typo in test name 2020-01-23 10:40:48 -05:00
Nikolay Martynov ad46239009
Merge pull request #1186 from DataDog/mar-kolya/update-gradle
Update gradle
2020-01-23 10:33:20 -05:00
Nikolay Martynov 950389587c Simplify groovy/scala/kotlin compile dependency hack 2020-01-23 09:40:15 -05:00
Nikolay Martynov be6a7730bf Update kotlin version 2020-01-23 09:40:15 -05:00
Nikolay Martynov 53026932a8 Update task tree plugin 2020-01-23 08:39:17 -05:00
Nikolay Martynov bc72b9271a Update gradle to 6.1 2020-01-23 08:39:06 -05:00
Laplie Anderson 4e58643bd0 Initial finatra instrumentation 2020-01-22 18:09:10 -05:00
Tyler Benson 5c6f74fd5e
Merge pull request #1177 from DataDog/tyler/scope-depth-limit
Add limit to trace scope depth
2020-01-22 12:13:23 -08:00
Tyler Benson 08e24bf3b6
Merge pull request #1184 from DataDog/tyler/test-timeout
Set timeouts on individual tests and increase overall test timeout.
2020-01-22 09:38:58 -08:00
Tyler Benson f9e43516ad Set timeouts on individual tests and increase overall test timeout. 2020-01-22 09:06:03 -08:00
Tyler Benson b7d599d82f
Merge pull request #1182 from DataDog/tyler/decorator-disable-case-insensitive
Check for both regular and lowercase names with decorator enabled flags.
2020-01-17 12:29:52 -08:00
Tyler Benson 5cce4cb783 Replace DDAgentWriter.Spec with a proper Builder.
Also rename the builder class on DDTracer to default name generated by Lombok.
2020-01-17 11:10:11 -08:00