调用blade-log失败后无限尝试导致本地产生大量重复的报错日志信息

Blade 未结 2 1267

一、该问题的重现步骤是什么?

1. 启动一个自定义业务的微服务,但是没有启动blade-log

2. 调用自定义微服务发布的接口,触发一个异常

3.该自定义微服务会产生大量日志


二、你期待的结果是什么?实际看到的又是什么?

调用blade-log失败后就跳过,不要无限循环调用;实际情况是接口一致在尝试调用,导致本地产生大量重复的报错日志信息

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

2.9.0

四、请提供详细的错误堆栈信息,这很重要。

2022-05-13 09:52:51.754 ERROR 1 --- [   async-task-9] o.s.c.b.c.BladeExecutorConfiguration     : Unexpected exception occurred invoking async method: public void org.springblade.core.log.event.ErrorLogListener.saveErrorLog(org.springblade.core.log.event.ErrorLogEvent)


java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have available server for client: blade-log

        at org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient.execute(LoadBalancerFeignClient.java:91)

        at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:119)

        at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:89)

        at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)

        at com.sun.proxy.$Proxy148.saveErrorLog(Unknown Source)

        at org.springblade.core.log.event.ErrorLogListener.saveErrorLog(ErrorLogListener.java:54)

        at org.springblade.core.log.event.ErrorLogListener$$FastClassBySpringCGLIB$$da38bbb0.invoke(<generated>)

        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)

        at org.springblade.core.log.aspect.LogTraceAspect.around(LogTraceAspect.java:41)

        at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)

        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

        at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at org.springblade.core.context.BladeRunnableWrapper.run(BladeRunnableWrapper.java:54)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: blade-log

        at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:483)

        at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:184)

        at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180)

        at rx.Observable.unsafeSubscribe(Observable.java:10327)

        at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:94)

        at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:42)

        at rx.Observable.unsafeSubscribe(Observable.java:10327)

        at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber$1.call(OperatorRetryWithPredicate.java:127)

        at rx.internal.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler.enqueue(TrampolineScheduler.java:73)

        at rx.internal.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler.schedule(TrampolineScheduler.java:52)

        at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber.onNext(OperatorRetryWithPredicate.java:79)

        at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber.onNext(OperatorRetryWithPredicate.java:45)

        at rx.internal.util.ScalarSynchronousObservable$WeakSingleProducer.request(ScalarSynchronousObservable.java:276)

        at rx.Subscriber.setProducer(Subscriber.java:209)

        at rx.internal.util.ScalarSynchronousObservable$JustOnSubscribe.call(ScalarSynchronousObservable.java:138)

        at rx.internal.util.ScalarSynchronousObservable$JustOnSubscribe.call(ScalarSynchronousObservable.java:129)

        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.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)

        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)

        at rx.Observable.subscribe(Observable.java:10423)

        at rx.Observable.subscribe(Observable.java:10390)

        at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:443)

        at rx.observables.BlockingObservable.single(BlockingObservable.java:340)

        at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:112)

        at org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient.execute(LoadBalancerFeignClient.java:84)

        ... 29 common frames omitted


2022-05-13 09:52:51.757  WARN 1 --- [   async-task-9] .s.a.AnnotationAsyncExecutionInterceptor : Exception handler for async method 'public void org.springblade.core.log.event.ErrorLogListener.saveErrorLog(org.springblade.core.log.event.ErrorLogEvent)' threw unexpected exception itself


org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'errorEventListener': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)

        at org.springframework.context.event.ApplicationListenerMethodAdapter.getTargetBean(ApplicationListenerMethodAdapter.java:332)

        at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:297)

        at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:190)

        at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:153)

        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)

        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)

        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)

        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404)

        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361)

        at org.springblade.core.boot.config.BladeExecutorConfiguration$BladeAsyncUncaughtExceptionHandler.handleUncaughtException(BladeExecutorConfiguration.java:105)

        at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.handleError(AsyncExecutionAspectSupport.java:314)

        at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:124)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at org.springblade.core.context.BladeRunnableWrapper.run(BladeRunnableWrapper.java:54)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

五、若有更多详细信息,请在下面提供。

2条回答
  • Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: blade-log

    你要把blade-log这个服务正常启动注册到nacos

    作者追问:2022-05-13 15:01

    如果blade-log服务一旦发生异常中断,其他的微服务就有可能因产生大量日志导致磁盘写满,这里是否有规避该风险出现的办法

    作者追问:2022-05-16 22:04

    这个问题后面会考虑优化一下

    0 讨论(1)
  • 2024-02-23 11:46

    请问这个问题解决了么?我也会这样

    0 讨论(0)
提交回复