[
https://issues.apache.org/jira/browse/KAFKA-18982?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Edoardo Comar updated KAFKA-18982:
----------------------------------
Description:
When testing plug-in components to Kafka, such as a custom metric reporter,
it is very useful to reuse the ClusterTest extension to write integration tests
that spin Kafka instances under junit.
However the plugins may create additional Threads that should be tolerated
rather than being shown as a failure due to a Thread leak .
For example, testing the Prometheus Java libraries and hooking the registry to
report also JVM metrics, I encountered a thread being created due to a GC event.
{color:#1d1c1d}java.lang.Thread.<init>(Thread.java:715) at
java.lang.Thread.<init>(Thread.java:500) at
io.prometheus.metrics.core.util.Scheduler$DaemonThreadFactory.newThread(Scheduler.java:19)
at
...
io.prometheus.metrics.instrumentation.jvm.JvmMemoryPoolAllocationMetrics$AllocationCountingNotificationListener.handleNotification(JvmMemoryPoolAllocationMetrics.java:97)
at
sun.management.NotificationEmitterSupport.sendNotification(NotificationEmitterSupport.java:155)
at
com.sun.management.internal.GarbageCollectorExtImpl.createGCNotification(GarbageCollectorExtImpl.java:115){color}
I would like to annotate my custom ClusterTest as not to fail because of a
thread leak in such cases.
> Allow ClusterTests to ignore specific thread leaks
> --------------------------------------------------
>
> Key: KAFKA-18982
> URL: https://issues.apache.org/jira/browse/KAFKA-18982
> Project: Kafka
> Issue Type: Improvement
> Components: unit tests
> Reporter: Edoardo Comar
> Priority: Minor
>
> When testing plug-in components to Kafka, such as a custom metric reporter,
> it is very useful to reuse the ClusterTest extension to write integration
> tests that spin Kafka instances under junit.
> However the plugins may create additional Threads that should be tolerated
> rather than being shown as a failure due to a Thread leak .
> For example, testing the Prometheus Java libraries and hooking the registry
> to report also JVM metrics, I encountered a thread being created due to a GC
> event.
> {color:#1d1c1d}java.lang.Thread.<init>(Thread.java:715) at
> java.lang.Thread.<init>(Thread.java:500) at
> io.prometheus.metrics.core.util.Scheduler$DaemonThreadFactory.newThread(Scheduler.java:19)
> at
> ...
> io.prometheus.metrics.instrumentation.jvm.JvmMemoryPoolAllocationMetrics$AllocationCountingNotificationListener.handleNotification(JvmMemoryPoolAllocationMetrics.java:97)
> at
> sun.management.NotificationEmitterSupport.sendNotification(NotificationEmitterSupport.java:155)
> at
> com.sun.management.internal.GarbageCollectorExtImpl.createGCNotification(GarbageCollectorExtImpl.java:115){color}
>
> I would like to annotate my custom ClusterTest as not to fail because of a
> thread leak in such cases.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)