博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
记一个hystrix异常
阅读量:6602 次
发布时间:2019-06-24

本文共 11365 字,大约阅读时间需要 37 分钟。

hot3.png

在进行压测的时候,出现了异常:"could not be queued for execution and no fallback available."以及"Rejected command because thread-pool queueSize is at rejection threshold"

hystrix异常

com.netflix.hystrix.exception.HystrixRuntimeException: xxx#xxx(String,String) could not be queued for execution and no fallback available.    at com.netflix.hystrix.AbstractCommand$22.call(AbstractCommand.java:805)    at com.netflix.hystrix.AbstractCommand$22.call(AbstractCommand.java:790)    at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$4.onError(OperatorOnErrorResumeNextViaFunction.java:140)    at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onError(OnSubscribeDoOnEach.java:87)    at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onError(OnSubscribeDoOnEach.java:87)    at com.netflix.hystrix.AbstractCommand$DeprecatedOnFallbackHookApplication$1.onError(AbstractCommand.java:1451)    at com.netflix.hystrix.AbstractCommand$FallbackHookApplication$1.onError(AbstractCommand.java:1376)    at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onError(OnSubscribeDoOnEach.java:87)    at rx.observers.Subscribers$5.onError(Subscribers.java:230)    at rx.internal.operators.OnSubscribeThrow.call(OnSubscribeThrow.java:44)    at rx.internal.operators.OnSubscribeThrow.call(OnSubscribeThrow.java:28)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$4.onError(OperatorOnErrorResumeNextViaFunction.java:142)    at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onError(OnSubscribeDoOnEach.java:87)    at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onError(OnSubscribeDoOnEach.java:87)    at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$3.onError(AbstractCommand.java:1173)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:54)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.subscribe(Observable.java:10307)    at rx.Observable.subscribe(Observable.java:10274)    at rx.internal.operators.BlockingOperatorToFuture.toFuture(BlockingOperatorToFuture.java:51)    at rx.observables.BlockingObservable.toFuture(BlockingObservable.java:412)    at com.netflix.hystrix.HystrixCommand.queue(HystrixCommand.java:377)    at com.netflix.hystrix.HystrixCommand.execute(HystrixCommand.java:343)    at feign.hystrix.HystrixInvocationHandler.invoke(HystrixInvocationHandler.java:159)

线程池异常

java.util.concurrent.RejectedExecutionException: Rejected command because thread-pool queueSize is at rejection threshold.    at com.netflix.hystrix.strategy.concurrency.HystrixContextScheduler$HystrixContextSchedulerWorker.schedule(HystrixContextScheduler.java:103)    at rx.internal.operators.OperatorSubscribeOn.call(OperatorSubscribeOn.java:45)    at rx.internal.operators.OperatorSubscribeOn.call(OperatorSubscribeOn.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)    at rx.Observable.unsafeSubscribe(Observable.java:10211)    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)    at rx.Observable.subscribe(Observable.java:10307)    at rx.Observable.subscribe(Observable.java:10274)    at rx.internal.operators.BlockingOperatorToFuture.toFuture(BlockingOperatorToFuture.java:51)    at rx.observables.BlockingObservable.toFuture(BlockingObservable.java:412)    at com.netflix.hystrix.HystrixCommand.queue(HystrixCommand.java:377)    at com.netflix.hystrix.HystrixCommand.execute(HystrixCommand.java:343)    at feign.hystrix.HystrixInvocationHandler.invoke(HystrixInvocationHandler.java:159)

配置

hystrix:  threadpool:    default:      coreSize: 200 ##并发执行的最大线程数,默认10      maxQueueSize: 200 ##BlockingQueue的最大队列数      queueSizeRejectionThreshold: 50 ##即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝    default:      execution:        timeout:          enabled: true        isolation:          strategy: THREAD          semaphore:            maxConcurrentRequests: 1000          thread:            timeoutInMilliseconds: 30000

调整下queueSizeRejectionThreshold

DOC→ 

转载于:https://my.oschina.net/u/3664884/blog/1845808

你可能感兴趣的文章
2018.10.27-dtoj-3996-Lesson5!(johnny)
查看>>
DataTable转换成json字符串
查看>>
iOS网络协议----HTTP/TCP/IP浅析
查看>>
ubuntu 12.04 安装 redis
查看>>
IOS_CGRect
查看>>
Sql Server中不常用的表运算符之APPLY(1)
查看>>
【DM642】ICELL Interface—Cells as Algorithm Containers
查看>>
linux所有命令失效的解决办法
查看>>
力扣算法题—085最大矩阵
查看>>
svs 在创建的时候 上传文件夹 bin obj 这些不要提交
查看>>
mysql-用命令导出、导入表结构或数据
查看>>
Tinkphp
查看>>
EntityFrameworkCore 一对一 && 一对多 && 多对多配置
查看>>
How to temporally disable IDE tools (load manually)
查看>>
Vue.js学习 Item4 -- 数据双向绑定
查看>>
几种排序方式的java实现(01:插入排序,冒泡排序,选择排序,快速排序)
查看>>
server application unavailable
查看>>
浅谈尾递归的优化方式
查看>>
eclipse 的小技巧
查看>>
频率域滤波
查看>>