openzipkin / zipkin-support

repository for support questions raised as issues
4 stars 2 forks source link

AsyncReporter thread warning on shutdown in sleuth #20

Open soumyadip007 opened 4 years ago

soumyadip007 commented 4 years ago

Describe the Bug

A clear and concise description of what the bug is. If you have a solution in mind, skip raising an issue and open a pull request instead. 12816 --- [on(4)-127.0.0.1] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [AsyncReporter{org.springframework.cloud.sleuth.zipkin2.sender.RestTemplateSender@7e9eef7a}] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method)

Steps to Reproduce

Steps to reproduce the behavior:

Expected Behaviour

Zipkin is not working while kafka is running

codefromthecrypt commented 4 years ago

Thanks for the report. please update to latest sleuth just to get code aligned with the discussion.

Meanwhile...Spring should close threads via AsyncReporter being closeable and defined as a bean AFAIK.. unless the type returned must also be closeable (vs spring looking at subtypes) Am I correct @spencergibb?

https://github.com/spring-cloud/spring-cloud-sleuth/blob/4ed3db9a2774c5418a72e480ea6f3e76a35956d4/spring-cloud-sleuth-zipkin/src/main/java/org/springframework/cloud/sleuth/zipkin2/ZipkinAutoConfiguration.java#L122

codefromthecrypt commented 4 years ago

@soumyadip007 PS you originally titled this about Kafka. I renamed the issue about the log you pasted which has nothing to do with Kafka. In general, let's start discussions in chat https://gitter.im/spring-cloud/spring-cloud-sleuth