Remove muzzle plugin check for dd clean up threads
This was needed to make sure that we are not leaving threads behind. Threads were GCed before - but root cause was GC of executor itself (see previous commit). Now threads may stay between muzzle tasks if GC doesn't need to run yes so this check actually creates false positives.
This commit is contained in:
parent
4deb68bfd7
commit
0f4e0f40e4
|
@ -15,7 +15,6 @@ import org.eclipse.aether.spi.connector.transport.TransporterFactory
|
||||||
import org.eclipse.aether.transport.http.HttpTransporterFactory
|
import org.eclipse.aether.transport.http.HttpTransporterFactory
|
||||||
import org.eclipse.aether.version.Version
|
import org.eclipse.aether.version.Version
|
||||||
import org.gradle.api.Action
|
import org.gradle.api.Action
|
||||||
import org.gradle.api.GradleException
|
|
||||||
import org.gradle.api.Plugin
|
import org.gradle.api.Plugin
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.Task
|
import org.gradle.api.Task
|
||||||
|
@ -279,12 +278,6 @@ class MuzzlePlugin implements Plugin<Project> {
|
||||||
Method assertionMethod = instrumentationCL.loadClass('datadog.trace.agent.tooling.muzzle.MuzzleVersionScanPlugin')
|
Method assertionMethod = instrumentationCL.loadClass('datadog.trace.agent.tooling.muzzle.MuzzleVersionScanPlugin')
|
||||||
.getMethod('assertInstrumentationMuzzled', ClassLoader.class, ClassLoader.class, boolean.class)
|
.getMethod('assertInstrumentationMuzzled', ClassLoader.class, ClassLoader.class, boolean.class)
|
||||||
assertionMethod.invoke(null, instrumentationCL, userCL, muzzleDirective.assertPass)
|
assertionMethod.invoke(null, instrumentationCL, userCL, muzzleDirective.assertPass)
|
||||||
|
|
||||||
for (Thread thread : Thread.getThreads()) {
|
|
||||||
if (thread.getName().startsWith("dd-")) {
|
|
||||||
throw new GradleException("Task $taskName has spawned a thread: $thread. This will prevent GC of dynamic muzzle classes. Aborting muzzle run.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
runAfter.finalizedBy(muzzleTask)
|
runAfter.finalizedBy(muzzleTask)
|
||||||
|
|
Loading…
Reference in New Issue