dku*_*rni 22 java java.util.concurrent hystrix
我注意到我的应用程序中的一些命令失败了
Caused by: ! com.netflix.hystrix.exception.HystrixRuntimeException: GetAPICommand timed-out and no fallback available.
out: ! at com.netflix.hystrix.HystrixCommand.getFallbackOrThrowException(HystrixCommand.java:1631)
out: ! at com.netflix.hystrix.HystrixCommand.access$2000(HystrixCommand.java:97)
out: ! at com.netflix.hystrix.HystrixCommand$TimeoutObservable$1$1.tick(HystrixCommand.java:1025)
out: ! at com.netflix.hystrix.HystrixCommand$1.performBlockingGetWithTimeout(HystrixCommand.java:621)
out: ! at com.netflix.hystrix.HystrixCommand$1.get(HystrixCommand.java:516)
out: ! at com.netflix.hystrix.HystrixCommand.execute(HystrixCommand.java:425)
out: Caused by: ! java.util.concurrent.TimeoutException: null
out: !... 11 common frames omitted
Run Code Online (Sandbox Code Playgroud)
这是我的Hystrix配置覆盖:
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=210000
hystrix.threadpool.default.coreSize=50
hystrix.threadpool.default.maxQueueSize=100
hystrix.threadpool.default.queueSizeRejectionThreshold=50
Run Code Online (Sandbox Code Playgroud)
这是什么样的超时?它是外部应用程序的读/连接超时吗?我该如何调试呢?
小智 30
这是Hystrix命令超时,默认情况下,每个命令都会启用此超时,您可以使用属性定义值:
execution.isolation.thread.timeoutInMilliseconds: 此属性设置调用者观察超时并离开命令执行的时间(以毫秒为单位).Hystrix将HystrixCommand标记为TIMEOUT,并执行回退逻辑.
因此,您可以使用属性增加超时值或禁用命令的默认超时(如果适用于您的情况):
@HystrixProperty(name = "hystrix.command.default.execution.timeout.enabled", value = "false")
您可以在此处找到更多信息:https://github.com/Netflix/Hystrix/wiki/Configuration#CommandExecution
查看堆栈跟踪,这是 Hystrix 在您上面定义的 210 秒后抛出的异常。
需要TimeoutException
在每个可能抛出此异常的方法上声明一个已检查的异常。run()
您将在代码的方法中看到此声明。
您可以像任何其他程序一样调试它,但请注意该run()
方法在与调用者分开的线程中运行。210 秒后,尽管您进行了调试会话,调用者仍将继续。
归档时间: |
|
查看次数: |
59246 次 |
最近记录: |