gpt4 book ai didi

java.lang.IllegalStateException : Shutdown in progress in XMemcachedClient. 关闭

转载 作者:行者123 更新时间:2023-12-02 09:05:47 25 4
gpt4 key购买 nike

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

线程“Thread-9”中出现异常 java.lang.IllegalStateException:正在关闭 在 java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:82) 在 java.lang.Runtime.removeShutdownHook(Runtime.java:239) 在 com.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);
}

最佳答案

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

关于java.lang.IllegalStateException : Shutdown in progress in XMemcachedClient. 关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18446821/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com