3

我的 XMemcached 相关代码出现异常。谁能帮我解决这个问题?非常感谢您的先进!

线程“Thread-9”java.lang.IllegalStateException 中的异常:在 java.lang.Runtime.removeShutdownHook(Runtime.java:239) 处的 java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:82) 处正在关闭。 google.code.yanf4j.core.impl.AbstractController.stop(AbstractController.java:476) 在 net.rubyeye.xmemcached.XMemcachedClient.shutdown(XMemcachedClient.java:2482) 在 net.rubyeye.xmemcached.XMemcachedClient$1.run(XMemcachedClient .java:650) ... 更多

    MemcachedClient client = LowCardinalityMemcachedClientSingleton.getPrimaryClient();
    try {
        if(client.isShutdown() != true){
            client.shutdown();
        } else{
            logger.debug("client already shutdown");
        }
    } catch (IOException e) {
         logger.debug("Shutdown MemcachedClient fail", e);
    }

    long startTime = System.currentTimeMillis();
    long total = 0;
    logger.debug("about to run wait loop");

    while(client.isShutdown() == false || 
            total < 4000){
        long stopTime = System.currentTimeMillis();
         total = stopTime - startTime;
        if(total > 12000){
            logger.debug("breaking because waiting more than 12 seconds");
            break;          
        }
    }


    logger.debug("exiting");
    System.exit(0);
}
4

1 回答 1

0

那是一个 xmencache 缺陷。我已经联系了作者并在下一个最新版本中修复了这个问题。

于 2014-06-19T13:09:17.127 回答