spring-cloud/spring-cloud-sleuth

LazyTraceThreadPoolTaskExecutor.getQueueSize() does not call a delegate and always returns 0

vg2902 opened this issue ยท 3 comments

vg2902 commented

Describe the bug
When enabled, Sleuth instruments ThreadPoolTaskExecutor beans by wrapping them in LazyTraceThreadPoolTaskExecutor proxies.
Unlike the other ThreadPoolTaskExecutor methods, LazyTraceThreadPoolTaskExecutor for some reason does not
override/delegate getQueueSize(), which is always returning 0.

Sample

sleuth-instrumentation-thread-pool-bug.zip

It is a simple Spring Boot application with an async method and custom ThreadPoolTaskExecutor for it.
There is a test emulating a concurrent workload by submitting more tasks than the custom executor can process simultaneously.

The test runs twice, with Sleuth on and off respectively.

Just execute mvn clean verify

Hey thanks for filing the issue. Are you willing to file a pr with a fix and a test? ๐Ÿ™‚

vg2902 commented

Hey thanks for filing the issue. Are you willing to file a pr with a fix and a test? ๐Ÿ™‚

Sure, just raised one:

#2316