spring-cloud / spring-cloud-netflix

Integration with Netflix OSS components
http://cloud.spring.io/spring-cloud-netflix/
Apache License 2.0
4.87k stars 2.44k forks source link

Threads need cleaning up when context closes #106

Closed dsyer closed 6 years ago

dsyer commented 9 years ago

Tomcat 8 nails us with a warning on almost all apps now because of Threads that are still running when it closes down. Not really more than cosmetic, but worth looking into.

spencergibb commented 9 years ago

Here's one clean up from a zuul filter d4d1fe7f636f473832273a657481e27012343ee4

spencergibb commented 9 years ago

The others (that I have seen) seem to be spring trying to clean up and tomcat trying to clean up (shutting down using /shutdown btw)

2014-12-16 15:45:07.054  INFO 94685 --- [       Thread-5] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7a5c978a: startup date [Tue Dec 16 15:44:57 MST 2014]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@22d16a1f
2014-12-16 15:45:07.056  INFO 94685 --- [       Thread-5] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 2147483647
2014-12-16 15:45:07.057  INFO 94685 --- [       Thread-5] c.n.h.c.m.e.HystrixMetricsPoller         : Stopping the Servo Metrics Poller
2014-12-16 15:45:07.058  INFO 94685 --- [       Thread-5] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 0
2014-12-16 15:45:07.068  INFO 94685 --- [       Thread-5] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_SIDECARTEST/sgibb-mbp.local - deregister  status: 404
2014-12-16 15:45:07.072 DEBUG 94685 --- [       Thread-5] o.s.b.a.e.jmx.EndpointMBeanExporter      : Unregistering JMX-exposed beans on shutdown
2014-12-16 15:45:07.072 DEBUG 94685 --- [       Thread-5] o.s.b.a.e.jmx.EndpointMBeanExporter      : Unregistering JMX-exposed beans
2014-12-16 15:45:07.073  INFO 94685 --- [       Thread-5] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2014-12-16 15:45:07.073  INFO 94685 --- [       Thread-5] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans
2014-12-16 15:45:07.089  INFO 94685 --- [       Thread-5] c.n.e.EurekaDiscoveryClientConfiguration : Removing application sidecarTest from eureka
2014-12-16 15:45:07.092  INFO 94685 --- [       Thread-5] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_SIDECARTEST/sgibb-mbp.local - deregister  status: 404
2014-12-16 15:45:07.145  INFO 94685 --- [       Thread-5] o.apache.catalina.core.StandardService   : Stopping service Tomcat
2014-12-16 15:45:07.148  INFO 94685 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Destroying Spring FrameworkServlet 'dispatcherServlet'
2014-12-16 15:45:07.149  INFO 94685 --- [ost-startStop-1] o.s.c.n.zuul.ZuulFilterInitializer       : Stopping filter initializer context listener
2014-12-16 15:45:14.777  WARN 94685 --- [PollScheduler-1] c.n.s.p.MonitorRegistryMetricPoller      : timeout trying to get value for MonitorConfig{name=DiscoveryClient-HTTPClient_CreateConnectionTimer, tags=statistic=totalTime,class=NamedConnectionPool,GAUGE,id=DiscoveryClient-HTTPClient,unit=MILLISECONDS, policy=DefaultPublishingPolicy}
2014-12-16 15:46:05.036  WARN 94685 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [Thread-5] 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)
 java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
 java.util.concurrent.FutureTask.awaitDone(FutureTask.java:425)
 java.util.concurrent.FutureTask.get(FutureTask.java:187)
 org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:973)
 org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
 org.apache.catalina.core.StandardService.stopInternal(StandardService.java:501)
 org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
 org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:781)
 org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
 org.apache.catalina.startup.Tomcat.stop(Tomcat.java:349)
 org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.stop(TomcatEmbeddedServletContainer.java:245)
 org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.stopAndReleaseEmbeddedServletContainer(EmbeddedWebApplicationContext.java:277)
 org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:142)
 org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:836)
 org.springframework.boot.actuate.endpoint.ShutdownEndpoint$1.run(ShutdownEndpoint.java:70)
 java.lang.Thread.run(Thread.java:744)
2014-12-16 15:46:05.140  INFO 94685 --- [       Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@22d16a1f: startup date [Tue Dec 16 15:44:55 MST 2014]; root of context hierarchy
Disconnected from the target VM, address: '127.0.0.1:51772', transport: 'socket'
spencergibb commented 9 years ago

A few more DiscoveryClient.discoveryJerseyClient and from ServoMetricCollector PollScheduler 71d0a474f7c78b7d03be1b5f1309b7d55ed1a056

dsyer commented 9 years ago

Haven't seen this in a while.

dsyer commented 9 years ago

Here's some more (from Zuul integration tests):

2015-02-05 14:32:17.906  WARN 16690 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [expiringMap-0] 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)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 java.lang.Thread.run(Thread.java:744)
2015-02-05 14:32:17.907  WARN 16690 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [Connection pool clean up thread] 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)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 java.lang.Thread.run(Thread.java:744)
2015-02-05 14:32:17.908  WARN 16690 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [Connection pool clean up thread] 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)
 java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1088)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 java.lang.Thread.run(Thread.java:744)
2015-02-05 14:32:17.911  WARN 16690 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [DataPublisher] 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)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 java.lang.Thread.run(Thread.java:744)
2015-02-05 14:32:17.937  INFO 16690 --- [       Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@3d51f06e: startup date [Thu Feb 05 14:32:09 CET 2015]; root of context hierarchy
pradeepkusingh commented 8 years ago

I am seeing this issue in our environment:

Thu Mar 17 11:08:15 MDT 2016 WARN [APP:null TRACKING_ID:null ACCOUNT_NUM:null] org.apache.catalina.loader.WebappClassLoaderBase - The web application [ROOT] appears to have started a thread named [expiringMap-0] 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)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 java.lang.Thread.run(Thread.java:745)
vasandharaj commented 8 years ago

I am also facing this same issue on Tomcat 7.0.65 and spring cloud netflix 1.2.1 Release.

Any solution or work around for it ??

spencergibb commented 8 years ago

@vasandharaj they are just warnings

vasandharaj commented 8 years ago

@spencergibb

Its a SEVERE in our tomcat 7.0.65 and it occurs only when we stopping our application through tomcat manager

SEVERE: The web application [/app] appears to have started a thread named [expiringMap-0] but has failed to stop it. This is very likely to create a memory leak. Oct 27, 2016 11:29:39 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/app] appears to have started a thread named [PollingServerListUpdater-0] but has failed to stop it. This is very likely to create a memory leak. Oct 27, 2016 11:29:39 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/app] appears to have started a thread named [DataPublisher] but has failed to stop it. This is very likely to create a memory leak. Oct 27, 2016 11:29:39 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/app] appears to have started a thread named [PollingServerListUpdater-1] but has failed to stop it. This is very likely to create a memory leak. Oct 27, 2016 11:29:39 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/app] created a ThreadLocal with key of type [com.netflix.hystrix.metric.HystrixThreadEventStream$1](value [com.netflix.hystrix.metric.HystrixThreadEventStream$1@272d6cf]) and a value of type [com.netflix.hystrix.metric.HystrixThreadEventStream](value [HystrixThreadEventStream %2877 - http-apr-8050-exec-14%29]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Oct 27, 2016 11:29:39 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/app] created a ThreadLocal with key of type [com.netflix.hystrix.Hystrix$1](value [com.netflix.hystrix.Hystrix$1@cfd4200]) and a value of type [com.netflix.hystrix.Hystrix.ConcurrentStack](value [com.netflix.hystrix.Hystrix$ConcurrentStack@4174b14a]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

So we have impemented the

@Component
public class GatewayServletContextListener implements ServletContextListener{

    private static final Logger LOGGER = LoggerFactory.getLogger(GatewayServletContextListener.class);

    @Override
    public void contextInitialized(ServletContextEvent arg0) {
        LOGGER.info("Servlet context listener observed context initialized");
    }

    @Override
    public void contextDestroyed(ServletContextEvent arg0) {
        LOGGER.info("Servlet context listener observed context destroyed");
        cleanupThreadLocals();
    }

    /**
     * Cleanup thread locals.
     */
    private void cleanupThreadLocals() {

        try {
                LOGGER.info("Cleaning up ThreadLocals ...");

                Hystrix.reset();

                //HystrixPlugins.reset();

            } catch(Exception e) {
                LOGGER.error(e.getMessage(), e);
            }

    }

}

But still it same we are getting the same exception any workarounds are also appreciable.

Merry1227 commented 7 years ago

@spencergibb , I am seeing the same warnings in our environment. When I look up to the implementation of DataPublisher in com.netflix.stats.distribution and the usage class ServerStats. I really found the close() method which will call DataPublisher.stop to stop the long-running periodical thread should be called when spring shutdown. But It seems actually not!!! Cloud you confirm it? Thank you in advance. 2017-08-25 10:51:29.044 WARN 5 --- [localhost-startStop-2] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [DataPublisher] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:

ryanjbaxter commented 7 years ago

@Merry1227 can you provide a project that reproduces it? Please dont post the same comment to multiple issues.

Merry1227 commented 7 years ago

@ryanjbaxter Thank you for your quick response. DataPublisher from netflix-commons, the main usage to it ServerStats from ribbon-loadbalancer. And Giving more background, This warning will not appeared if we just start our spring boot application and then shutdown at once, While it will appear if the application running over certain time and then shut down it.

Merry1227 commented 7 years ago

@ryanjbaxter And according to my initial investigation, the main doubt is the stop methods in DataPublisher (Or saying close() in ServerStats) which I guess is planed to provide a hook to clean up the thread when shutdown gracefully, but it may be forgotten be called. Because I just see some code snippets, I am not 100% certain it. Please help to forward the message if the owner of the ServerStats is not you. Thanking you.

LorenzoLou commented 7 years ago

@Merry1227 Whether i am possible to get the cache and closed manually ? private final LoadingCache<Server, ServerStats> serverStatsCache = CacheBuilder.newBuilder() .expireAfterAccess(SERVERSTATS_EXPIRE_MINUTES.get(), TimeUnit.MINUTES) .removalListener(new RemovalListener<Server, ServerStats>() { @Override public void onRemoval(RemovalNotification<Server, ServerStats> notification) { notification.getValue().close(); } }) .build( new CacheLoader<Server, ServerStats>() { public ServerStats load(Server server) { return createServerStats(server); } });

LorenzoLou commented 7 years ago

@spencergibb maby the ScheduledExecutorService would not be closed when the cache's removalListener in LoadBalancerStats be called,and i've made a test,in this test case the warning can be eliminated and when i don't shutdown the sharedExecutor warning recurrented: `
@RequestMapping(value = "/testWarning", method = RequestMethod.PUT) @ResponseBody public ApiData testWarning() { class PublishThreadFactory implements ThreadFactory { PublishThreadFactory() { } public Thread newThread(Runnable r) { Thread t = new Thread(r, "weiming shutdown test"); t.setDaemon(true); return t; } } ScheduledFuture future; ScheduledExecutorService sharedExecutor = Executors.newScheduledThreadPool(1, new PublishThreadFactory()); Runnable task = new Runnable() { public void run() { try { Thread.sleep(100000); System.out.print("asdf"); } catch (Exception e) { } } }; future = sharedExecutor.scheduleWithFixedDelay(task, 1, 30000, TimeUnit.MILLISECONDS); future.cancel(false); sharedExecutor.shutdown(); try { Thread.sleep(1000); }catch (Exception e) {

        }
    this.applicationContext.close();
    return new ApiData(new ApiMeta(), null);
}`
ankitkurani commented 6 years ago

We are seeing a similar problem with Tomcat 8.0.35. The errors: 03-Jan-2018 09:45:00.098 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [r3_epmp_i] created a ThreadLocal with key of type [com.netflix.hystrix.metric.HystrixThreadEventStream$1] (value [com.netflix.hystrix.metric.HystrixThreadEventStream$1@4be5028a]) and a value of type [com.netflix.hystrix.metric.HystrixThreadEventStream] (value [HystrixThreadEventStream (317 - hystrix-TokenCache-11)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 03-Jan-2018 09:45:00.099 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [r3_epmp_i] created a ThreadLocal with key of type [com.netflix.hystrix.metric.HystrixThreadEventStream$1] (value [com.netflix.hystrix.metric.HystrixThreadEventStream$1@4be5028a]) and a value of type [com.netflix.hystrix.metric.HystrixThreadEventStream] (value [HystrixThreadEventStream (328 - hystrix-TokenCache-12)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 03-Jan-2018 09:45:00.099 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [r3_epmp_i] created a ThreadLocal with key of type [com.netflix.hystrix.metric.HystrixThreadEventStream$1] (value [com.netflix.hystrix.metric.HystrixThreadEventStream$1@4be5028a]) and a value of type [com.netflix.hystrix.metric.HystrixThreadEventStream] (value [HystrixThreadEventStream (329 - hystrix-TokenCache-13)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 03-Jan-2018 09:45:00.100 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [r3_epmp_i] created a ThreadLocal with key of type [com.netflix.hystrix.metric.HystrixThreadEventStream$1] (value [com.netflix.hystrix.metric.HystrixThreadEventStream$1@4be5028a]) and a value of type [com.netflix.hystrix.metric.HystrixThreadEventStream] (value [HystrixThreadEventStream (330 - hystrix-TokenCache-14)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 03-Jan-2018 09:45:00.100 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [r3_epmp_i] created a ThreadLocal with key of type [com.netflix.hystrix.metric.HystrixThreadEventStream$1] (value [com.netflix.hystrix.metric.HystrixThreadEventStream$1@4be5028a]) and a value of type [com.netflix.hystrix.metric.HystrixThreadEventStream] (value [HystrixThreadEventStream (331 - hystrix-TokenCache-15)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

MeiyappanKannappa commented 6 years ago

Hi I am facing the same issue when stopping the spring boot appliccation. I get same error as below 2018-05-29 15:24:55.700 WARN 7752 --- [ost-startStop-2] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [expiringMap-0] 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)
 java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
 java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
 java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 java.lang.Thread.run(Unknown Source)

My Zuul Filter code is

  @Override
  public Object run() {
    return true;
  }

Could anyone please help

ryanjbaxter commented 6 years ago

There is nothing here that indicates this is related to Spring Cloud Netflix. If you believe there is a problem with Spring Cloud Netflix, please open a new issue and provide all the details request in the instructions.

duanhaowei commented 6 years ago

same problem here. but here are some warn before fail

o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [RxIoScheduler-1 (Evictor)] 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)

i found the bug is because one of my new thread is sleep , and i did not determine it .

the bug is noe related to Spring Cloud Netfix.

ryanjbaxter commented 6 years ago

@duanhaowei it is impossible to help when just dumping an unformatted stack trace in a closed issue. Please open a new issue and file the guidelines for creating a good issue so we can better help you.

duanhaowei commented 6 years ago

@ryanjbaxter thanks dude , i just resolve my problem .

MeiyappanKannappa commented 6 years ago

@duanhaowei Could you please let know how did you resolve the issue. Thanks!

pradeepgnd commented 6 years ago

@duanhaowei how did you resolve this issue. Thanks!

duanhaowei commented 6 years ago

@MeiyappanKannappa @pradeepgnd in my code , is a Thread problem , i used Thread.sleep but did not handle exception well . so , when spring application in shutdown process , there is still a custom thread active , it prevent tomcat shutdown. after i fixd it , warning about'sun.misc.Unsafe.park' still appear , but tomcat is shudown finally

spencergibb commented 6 years ago

Closing due to age and inactivity.