原因应该是consul 那边报出来的错误
本文是通过集成的eureka prometheus 版本是2.16.0
<dependency>
<groupId>at.twinformatics</groupId>
<artifactId>eureka-consul-adapter</artifactId>
<version>1.1.0</version>
</dependency>
网上的解决办法是spring.mvc.async.request-timeout=-1
报错信息prometheus
level=error ts=2020-03-30T09:15:46.337Z caller=consul.go:370 component="discovery manager scrape" discovery=consul msg="Error refreshing service list" err="Unexpected response code: 503 ({\"timestamp\":\"2020-03-30T09:15:46.332+0000\",\"status\":503,\"error\":\"Service Unavailable\",\"message\":\"No message available\",\"path\":\"/v1/catalog/services\"})"
此处提一下 prometheus 自然有超时设置
consul.go
watchTimeout = 30 * time.Second
但此处说的不是这个 这个对应的超时错误是
level=error ts=2020-03-31T12:48:40.136Z caller=consul.go:484 component="discovery manager scrape" discovery=consul msg="Error refreshing service" service=SPRINGBOOT_PROMETHEUS_CLIENT tags="unsupported value type" err="Get \"http://127.0.0.1:8761/v1/catalog/service/SPRINGBOOT_PROMETHEUS_CLIENT?index=1585648670986&stale=&wait=30000ms\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"
go on registry(集成了consul adapter)
org.springframework.web.context.request.async.AsyncRequestTimeoutException
怎么能止步于此?
问题1 : 如果不设置 time-out 默认值是多少?
问题2 : 这个判断超时的逻辑在哪?
查看tomcat的启动逻辑
问题1已搞定
堆栈分析
java.lang.Thread#run
org.apache.tomcat.util.threads.TaskThread.WrappingRunnable#run
java.util.