gpt4 book ai didi

java - 为什么 cflock 有时会导致 'timeout value is negative' 错误?

转载 作者:行者123 更新时间:2023-11-29 08:56:30 30 4
gpt4 key购买 nike

我有一个 ColdFusion 事件网关,有时会在以下行中产生错误(其中 Local.curThread 是数字 1-5):

<cflock name="eventCachedQueryUpdate_thread_#Local.curThread#" timeout="0" throwontimeout="no">

错误是:

Message: timeout value is negative
Type: java.lang.IllegalArgumentException

这是一个 StackTrace:

java.lang.IllegalArgumentException: timeout value is negative at java.lang.Object.wait(Native Method) at coldfusion.runtime.RWLock.waitForLock(RWLock.java:154) at coldfusion.runtime.RWLock.requestWriteLock(RWLock.java:124) at coldfusion.runtime.RWLock.requestLock(RWLock.java:46) at coldfusion.runtime.LockManager.requestNamedLock(LockManager.java:73) at coldfusion.tagext.lang.LockTag.doStartTag(LockTag.java:186) at cfeventCachedQueryUpdate2ecfc749015300$funcONINCOMINGMESSAGE.runFunction(D:\Applications\CFusion\CustomTags\4C\eventCachedQueryUpdate.cfc:21) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:437) at coldfusion.filter.EventComponentFilter.invoke(EventComponentFilter.java:67) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:399) at coldfusion.filter.EventRequestMonitorFilter.invoke(EventRequestMonitorFilter.java:47) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.eventgateway.EventProxy.invokeComponent(EventProxy.java:66) at coldfusion.eventgateway.EventProxy.invokeComponent(EventProxy.java:47) at coldfusion.eventgateway.EventRequestHandler.invokeCFC(EventRequestHandler.java:185) at coldfusion.eventgateway.EventRequestHandler.processRequest(EventRequestHandler.java:111) at coldfusion.eventgateway.EventRequestDispatcher$Task.run(EventRequestDispatcher.java:122) at coldfusion.util.SimpleWorkerThread.run(SimpleThreadPool.java:210)

由于 cflock 的超时属性始终为 0,所以我看不出这会导致负超时值。知道是什么原因造成的以及如何预防吗?这是 cflock 中的错误吗?

我在装有 Java 1.6.0_17 的 Windows Server 2008 R2 上运行 Adob​​e ColdFusion 9.0.1.274733 Enterprise。

最佳答案

如果非要我猜的话,那就是事件网关请求的处理方式 timeout="0"不正确。 <cflock> for ColdFusion 9 的文档这么说:

If you set timout="0", the timeout is determined by the "Timeout Requests after x" setting in the ColdFusion Administrator Settings page, if that setting is enabled. However, if the setting is not enabled, and you set timeout="0", ColdFusion can wait indefinitely to obtain the lock.

也许 - 这真的只是猜测 - CF 处理在通过事件网关运行时错误超时的锁?

要排除故障,可以放一个 sleep()在锁定的代码中,以便并发网关请求超时,看看记录了什么?

您是否设置了请求超时?

关于java - 为什么 cflock 有时会导致 'timeout value is negative' 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20082504/

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