Spring Cloud:Zuul Broken Pipe Error

时间:2015-10-13 17:52:21

标签: spring-cloud netflix-zuul

我正在对由zuul代理服务支持的简单Spring云应用程序进行一些压力测试 由于Zuul和服务之间的陈旧连接,我们偶尔会出现管道故障。 我使用不同的配置选项配置Zuul但没有成功:

hystrix:
  command:
    default:
      execution:
        isolation:
          strategy: THREAD
          thread:
            timeoutInMilliseconds: 61000


ribbon:
  ReadTimeout: 60000
  ConnectTimeout: 6000

zuul:
  host:
    socket-timeout-millis: 60000
    connect-timeout-millis: 60000

感谢先进的任何线索,以解决这个问题。 例外情况如下: `

  

com.netflix.zuul.exception.ZuulException:转发错误       在org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:151)〜[router.jar!/:0.0.1]       在org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:114)〜[router.jar!/:0.0.1]       在com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:112)〜[zuul-core-1.0.28.jar!/:na]

     

引起:com.netflix.hystrix.exception.HystrixRuntimeException:query-serviceRibbonCommand失败,没有可用的回退。       在com.netflix.hystrix.AbstractCommand $ 20.call(AbstractCommand.java:816)〜[hystrix-core-1.4.0-RC6.jar!/:na]       在com.netflix.hystrix.AbstractCommand $ 20.call(AbstractCommand.java:798)〜[hystrix-core-1.4.0-RC6.jar!/:na]       at rx.internal.operators.OperatorOnErrorResumeNextViaFunction $ 1.onError(OperatorOnErrorResumeNextViaFunction.java:77)〜[rxjava-1.0.4.jar!/:1.0.4]       在rx.internal.operators.OperatorDoOnEach $ 1.onError(OperatorDoOnEach.java:70)〜[rxjava-1.0.4.jar!/:1.0.4]

     

引起:java.net.SocketException:管道损坏       at java.net.SocketOutputStream.socketWrite0(Native Method)〜[na:1.8.0_45]       在java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)〜[na:1.8.0_45]       在java.net.SocketOutputStream.write(SocketOutputStream.java:153)〜[na:1.8.0_45]       在org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:159)〜[httpcore-4.3.3.jar!/:4.3.3]       ...       在rx.internal.operators.OperatorMap $ 1.onNext(OperatorMap.java:55)〜[rxjava-1.0.4.jar!/:1.0.4]       在com.netflix.loadbalancer.reactive.LoadBalancerCommand $ 1.call(LoadBalancerCommand.java:185)〜[ribbon-loadbalancer-2.0-RC13.jar!/:na]       在com.netflix.loadbalancer.reactive.LoadBalancerCommand $ 1.call(LoadBalancerCommand.java:180

1 个答案:

答案 0 :(得分:4)

我遇到了同样的问题:我已经通过将zuul执行超时添加到zuul服务器的 application.yml 来解决了这个问题:

# Increase the Hystrix timeout to 60s (globally)
hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000

请参阅netflix问题的这个主题:https://github.com/spring-cloud/spring-cloud-netflix/issues/321