Skip to content

Commit 8e43f42

Browse files
authored
Merge pull request #1342 from arjan-bal/PLUGIN-1727/remove-open-census-impl
[PLUGIN-1727] Remove opencensus-impl dependency from GCS connector
2 parents 00d2daa + 6cca7b6 commit 8e43f42

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

pom.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,10 @@
597597
<artifactId>grpc-api</artifactId>
598598
<groupId>io.grpc</groupId>
599599
</exclusion>
600+
<exclusion>
601+
<groupId>io.opencensus</groupId>
602+
<artifactId>opencensus-impl</artifactId>
603+
</exclusion>
600604
<exclusion>
601605
<artifactId>grpc-census</artifactId>
602606
<groupId>io.grpc</groupId>
@@ -962,6 +966,39 @@
962966
</execution>
963967
</executions>
964968
</plugin>
969+
<plugin>
970+
<groupId>org.apache.maven.plugins</groupId>
971+
<artifactId>maven-enforcer-plugin</artifactId>
972+
<version>3.4.1</version>
973+
<executions>
974+
<execution>
975+
<id>enforce-banned-dependencies</id>
976+
<goals>
977+
<goal>enforce</goal>
978+
</goals>
979+
<configuration>
980+
<rules>
981+
<bannedDependencies>
982+
<excludes>
983+
<exclude>io.opencensus:opencensus-impl</exclude>
984+
</excludes>
985+
<message>
986+
Exclude Open Census implementations to disable Open Census stats and tracing.
987+
They are not used by the plugins. For tracing, Open Census spawns a new thread
988+
and loads a single global instance of a TracingComponent. CDAP uses a separate
989+
class loader for each plugin. This leads to spawning a new thread for each plugin
990+
with the Open Census dependency. As this thread keeps a reference to the class
991+
loader, it prevents the class loader from being garbage collected leading
992+
to leaks. If no implementation of TracingComponent is found at runtime,
993+
Open Census uses a NoopTraceComponent.
994+
</message>
995+
</bannedDependencies>
996+
</rules>
997+
<fail>true</fail>
998+
</configuration>
999+
</execution>
1000+
</executions>
1001+
</plugin>
9651002
</plugins>
9661003
</build>
9671004

0 commit comments

Comments
 (0)