简体   繁体   English

Redisson没有关闭使Java VM保持打开状态

[英]Redisson not shutting down keeps Java VM open

I have the following simple code: 我有以下简单的代码:

RedissonClient redisson = Redisson.create();

RMap<Object, Object> mymap = redisson.getMap("mymap");
mymap.put("field1", "value1");
mymap.put("field1", "value2");

redisson.shutdown();

logger.info("Here but JVM still runs after this line");

And the output is: 输出为:

2018-02-01 15:24:14 INFO  Version:41 - Redisson 3.6.0
2018-02-01 15:24:14 INFO  MasterPubSubConnectionPool:144 - 1 connections initialized for /127.0.0.1:6379
2018-02-01 15:24:14 INFO  MasterConnectionPool:144 - 10 connections initialized for /127.0.0.1:6379
2018-02-01 15:24:17 INFO  RedisTest:21 - Here but JVM still runs after this line

What is other than shutdown needed for graceful shutdown? 除了正常关机所需的关机以外,还有什么? I got a thread dump and see the following non-daemon thread: 我得到了一个线程转储,并看到以下非守护程序线程:

"ObjectCleanerThread" #13 prio=1 os_prio=31 tid=0x00007f885a05e800 nid=0xa803 in Object.wait() [0x00007000092cf000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x000000076ab108b0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
    - locked <0x000000076ab108b0> (a java.lang.ref.ReferenceQueue$Lock)
    at io.netty.util.internal.ObjectCleaner$1.run(ObjectCleaner.java:52)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

It seems that is a bug in netty: https://github.com/netty/netty/issues/7617 看来这是netty的错误: https//github.com/netty/netty/issues/7617

The issue seems to be resolved but I guess it is not released yet. 该问题似乎已解决,但我想它尚未发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM