1

我有以下设置:

  • Spring Cloud Eureka Server(带有 Spring Boot 应用程序@EnableEurekaServer
  • Spring Cloud Sidecar(运行:8080
  • 同一个 Spring Boot 应用程序的 2 个实例在 Eureka ( @EnableEurekaClient) 上正确注册并公开一个GET /configurations端点(在:8081and上运行:8082

所有这些都在 Java 8 + Spring Cloud 1.1.0.M5 上运行。

通过 Sidecar 调用 REST 端点:8080工作正常,请求负载平衡正确,客户端响应正确。如果我关闭 2 个应用程序实例之一并再次调用端点,客户端会收到此错误:

{
  "timestamp": 1458328852272,
  "status": 500,
  "error": "Internal Server Error",
  "exception": "com.netflix.zuul.exception.ZuulException",
  "message": "Forwarding error"
}

Sidecar 日志显示以下内容:

[2m2016-03-18 15:20:50.201[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.zuul.http.HttpServletRequestWrapper [0;39m [2m:[0;39m Path = null
[2m2016-03-18 15:20:50.201[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.zuul.http.HttpServletRequestWrapper [0;39m [2m:[0;39m Transfer-Encoding = null
[2m2016-03-18 15:20:50.201[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.zuul.http.HttpServletRequestWrapper [0;39m [2m:[0;39m Content-Encoding = null
[2m2016-03-18 15:20:50.201[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.zuul.http.HttpServletRequestWrapper [0;39m [2m:[0;39m Content-Length header = -1
[2m2016-03-18 15:20:50.209[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.loadbalancer.ZoneAwareLoadBalancer  [0;39m [2m:[0;39m Zone aware logic disabled or there is only one zone
[2m2016-03-18 15:20:50.209[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.loadbalancer.LoadBalancerContext    [0;39m [2m:[0;39m blue-config using LB returned Server: localhost:blue-config:6ef471326fe62d8877b94e2a8be06058 for request /configurations
[2m2016-03-18 15:20:50.211[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.niws.client.http.RestClient [0;39m [2m:[0;39m RestClient sending new Request(GET: ) http://localhost:8082/configurations
[2m2016-03-18 15:20:50.211[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.http4.MonitoredConnectionManager    [0;39m [2m:[0;39m Get connection: {}->http://localhost:8082, timeout = 2000
[2m2016-03-18 15:20:50.211[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NamedConnectionPool   [0;39m [2m:[0;39m [{}->http://localhost:8082] total kept alive: 2, total issued: 0, total allocated: 2 out of 200
[2m2016-03-18 15:20:50.211[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NamedConnectionPool   [0;39m [2m:[0;39m Getting free connection [{}->http://localhost:8082][null]
[2m2016-03-18 15:20:50.212[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NFHttpClient          [0;39m [2m:[0;39m Stale connection check
[2m2016-03-18 15:20:50.212[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NFHttpClient          [0;39m [2m:[0;39m Stale connection detected
[2m2016-03-18 15:20:51.240[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[ HystrixTimer-3][0;39m [36mcom.netflix.hystrix.AbstractCommand     [0;39m [2m:[0;39m No fallback for HystrixCommand. 

java.lang.UnsupportedOperationException: No fallback available.
    at com.netflix.hystrix.HystrixCommand.getFallback(HystrixCommand.java:284) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:311) [hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:306) [hystrix-core-1.4.23.jar:1.4.23]
    at rx.Observable$2.call(Observable.java:162) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) [rxjava-1.0.14.jar:1.0.14]
    at rx.Observable.unsafeSubscribe(Observable.java:7710) [rxjava-1.0.14.jar:1.0.14]
    at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:100) [rxjava-1.0.14.jar:1.0.14]
    at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70) [rxjava-1.0.14.jar:1.0.14]
    at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70) [rxjava-1.0.14.jar:1.0.14]
    at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$1.run(AbstractCommand.java:958) [hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable$1.call(HystrixContextRunnable.java:41) [hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable$1.call(HystrixContextRunnable.java:37) [hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable.run(HystrixContextRunnable.java:57) [hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$2.tick(AbstractCommand.java:978) [hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.util.HystrixTimer$1.run(HystrixTimer.java:100) [hystrix-core-1.4.23.jar:1.4.23]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_74]
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [na:1.8.0_74]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [na:1.8.0_74]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_74]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_74]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_74]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_74]

[2m2016-03-18 15:20:52.216[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.http4.MonitoredConnectionManager    [0;39m [2m:[0;39m Released connection is not reusable.
[2m2016-03-18 15:20:52.216[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NamedConnectionPool   [0;39m [2m:[0;39m Releasing connection [{}->http://localhost:8082][null]
[2m2016-03-18 15:20:52.217[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NamedConnectionPool   [0;39m [2m:[0;39m Notifying no-one, there are no waiting threads
[2m2016-03-18 15:20:52.218[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.l.reactive.LoadBalancerCommand      [0;39m [2m:[0;39m Got error com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect when executed on server localhost:blue-config:6ef471326fe62d8877b94e2a8be06058
[2m2016-03-18 15:20:52.220[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.loadbalancer.ZoneAwareLoadBalancer  [0;39m [2m:[0;39m Zone aware logic disabled or there is only one zone
[2m2016-03-18 15:20:52.220[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.loadbalancer.LoadBalancerContext    [0;39m [2m:[0;39m blue-config using LB returned Server: localhost:blue-config:7ffe630c9c6f6acf456faba18058bf55 for request /configurations
[2m2016-03-18 15:20:52.221[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.niws.client.http.RestClient [0;39m [2m:[0;39m RestClient sending new Request(GET: ) http://localhost:8081/configurations
[2m2016-03-18 15:20:52.221[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.http4.MonitoredConnectionManager    [0;39m [2m:[0;39m Get connection: {}->http://localhost:8081, timeout = 2000
[2m2016-03-18 15:20:52.221[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NamedConnectionPool   [0;39m [2m:[0;39m [{}->http://localhost:8081] total kept alive: 1, total issued: 0, total allocated: 1 out of 200
[2m2016-03-18 15:20:52.221[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NamedConnectionPool   [0;39m [2m:[0;39m Getting free connection [{}->http://localhost:8081][null]
[2m2016-03-18 15:20:52.221[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NFHttpClient          [0;39m [2m:[0;39m Stale connection check
[2m2016-03-18 15:20:52.223[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NFHttpClient          [0;39m [2m:[0;39m Attempt 1 to execute request
[2m2016-03-18 15:20:52.239[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NFHttpClient          [0;39m [2m:[0;39m Connection can be kept alive indefinitely
[2m2016-03-18 15:20:52.240[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mc.n.http4.MonitoredConnectionManager    [0;39m [2m:[0;39m Released connection is reusable.
[2m2016-03-18 15:20:52.240[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NamedConnectionPool   [0;39m [2m:[0;39m Releasing connection [{}->http://localhost:8081][null]
[2m2016-03-18 15:20:52.240[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NamedConnectionPool   [0;39m [2m:[0;39m Pooling connection [{}->http://localhost:8081][null]; keep alive indefinitely
[2m2016-03-18 15:20:52.240[0;39m [32mDEBUG[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mcom.netflix.http4.NamedConnectionPool   [0;39m [2m:[0;39m Notifying no-one, there are no waiting threads
[2m2016-03-18 15:20:52.243[0;39m [33m WARN[0;39m [35m3388[0;39m [2m---[0;39m [2m[nio-8080-exec-2][0;39m [36mo.s.c.n.z.filters.post.SendErrorFilter  [0;39m [2m:[0;39m Error during filtering

com.netflix.zuul.exception.ZuulException: Forwarding error
    at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:134) ~[spring-cloud-netflix-core-1.1.0.M5.jar:1.1.0.M5]
    at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:76) ~[spring-cloud-netflix-core-1.1.0.M5.jar:1.1.0.M5]
    at com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:112) ~[zuul-core-1.1.0.jar:1.1.0]
    at com.netflix.zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:197) ~[zuul-core-1.1.0.jar:1.1.0]
    at com.netflix.zuul.FilterProcessor.runFilters(FilterProcessor.java:161) ~[zuul-core-1.1.0.jar:1.1.0]
    at com.netflix.zuul.FilterProcessor.route(FilterProcessor.java:120) ~[zuul-core-1.1.0.jar:1.1.0]
    at com.netflix.zuul.ZuulRunner.route(ZuulRunner.java:96) ~[zuul-core-1.1.0.jar:1.1.0]
    at com.netflix.zuul.http.ZuulServlet.route(ZuulServlet.java:116) ~[zuul-core-1.1.0.jar:1.1.0]
    at com.netflix.zuul.http.ZuulServlet.service(ZuulServlet.java:81) ~[zuul-core-1.1.0.jar:1.1.0]
    at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:158) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.cloud.netflix.zuul.web.ZuulController.handleRequestInternal(ZuulController.java:43) [spring-cloud-netflix-core-1.1.0.M5.jar:1.1.0.M5]
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:147) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:237) [spring-boot-actuator-1.3.3.RELEASE.jar:1.3.3.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:112) [spring-boot-actuator-1.3.3.RELEASE.jar:1.3.3.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:87) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:103) [spring-boot-actuator-1.3.3.RELEASE.jar:1.3.3.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_74]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_74]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_74]
Caused by: com.netflix.hystrix.exception.HystrixRuntimeException: blue-config timed-out and no fallback available.
    at com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:806) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:790) ~[hystrix-core-1.4.23.jar:1.4.23]
    at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:99) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70) ~[rxjava-1.0.14.jar:1.0.14]
    at com.netflix.hystrix.AbstractCommand$DeprecatedOnFallbackHookApplication$1.onError(AbstractCommand.java:1521) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.AbstractCommand$FallbackHookApplication$1.onError(AbstractCommand.java:1411) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:314) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:306) ~[hystrix-core-1.4.23.jar:1.4.23]
    at rx.Observable$2.call(Observable.java:162) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:162) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable$2.call(Observable.java:154) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.Observable.unsafeSubscribe(Observable.java:7710) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:100) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70) ~[rxjava-1.0.14.jar:1.0.14]
    at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70) ~[rxjava-1.0.14.jar:1.0.14]
    at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$1.run(AbstractCommand.java:958) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable$1.call(HystrixContextRunnable.java:41) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable$1.call(HystrixContextRunnable.java:37) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable.run(HystrixContextRunnable.java:57) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$2.tick(AbstractCommand.java:978) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.util.HystrixTimer$1.run(HystrixTimer.java:100) ~[hystrix-core-1.4.23.jar:1.4.23]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:1.8.0_74]
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source) ~[na:1.8.0_74]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) ~[na:1.8.0_74]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[na:1.8.0_74]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_74]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_74]
    ... 1 common frames omitted
Caused by: java.util.concurrent.TimeoutException: null
    at com.netflix.hystrix.AbstractCommand$9.call(AbstractCommand.java:601) ~[hystrix-core-1.4.23.jar:1.4.23]
    at com.netflix.hystrix.AbstractCommand$9.call(AbstractCommand.java:581) ~[hystrix-core-1.4.23.jar:1.4.23]
    at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:99) ~[rxjava-1.0.14.jar:1.0.14]
    ... 15 common frames omitted

有趣的是,似乎检测到连接被拒绝错误(Stale connection detected)并且完成了对另一个实例的调用(我确实看到了传入的请求),但结果仍然是错误。我希望重试调用的响应返回给客户端。

这是一个里程碑错误还是我缺少一些配置来使其工作?

4

1 回答 1

2

事实证明,Hystrix 是超时的那个。设置hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 5000似乎可以解决问题。

谢谢斯宾塞!

于 2016-03-18T20:18:54.820 回答