java.net.SocketTimeoutException

Blade 未结 1 67
keep_slient
keep_slient 剑童 2021-09-24 11:54

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

  1. 服务启动正常

  2. 接口调用正常

  3. 所有的服务在运行一段时间后就一直出现这个错误


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

消除这个错误

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

SpringBlade v3.1.0

macOS BigSur 11.5.2


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

java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
    at java.net.SocketInputStream.read(SocketInputStream.java:171)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
    at com.alibaba.csp.sentinel.transport.command.http.HttpEventTask.readLine(HttpEventTask.java:142)
    at com.alibaba.csp.sentinel.transport.command.http.HttpEventTask.run(HttpEventTask.java:83)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

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

sentinel是根据开发文档搭建的 可以正常登录dashboard 应用都显示健康

docker pull bladex/sentinel-dashboard
docker run --name sentinel -d -p 8858:8858 -d bladex/sentinel-dashboard


1条回答
  • 日志显示连接超时了java.net.SocketTimeoutException: Read timed out。

    你进服务容器内部telnet一下sentinel容器的ip和端口,检查下是否能联通。

    作者追问:2021-09-25 22:36

    您好,sentinel控制台是可以访问,但是有一些问题,没有数据。

    图片.png

    然后我查看了一下docker上sentinel的启动日志:

    2021-08-07 03:29:31.789 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8719/metric?startTime=1628306268000&endTime=1628306274000&refetch=false> (ConnectionException: Connection timed out)


    作者追问:2021-09-26 00:04

    如果多次请求服务的话 实时监控是有数据的

    补充一下sentinel的启动日志 192.168.2.12是我的本地ip地址

    2021-08-07 00:03:49.931 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8721/metric?startTime=1628294489000&endTime=1628294495000&refetch=false> (ConnectionException: Connection timed out)
    2021-08-07 00:03:54.027 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8725/metric?startTime=1628294496000&endTime=1628294502000&refetch=false> (ConnectionException: Connection timed out)
    2021-08-07 00:03:54.027 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8723/metric?startTime=1628294496000&endTime=1628294502000&refetch=false> (ConnectionException: Connection timed out)
    2021-08-07 00:03:54.028 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8726/metric?startTime=1628294496000&endTime=1628294502000&refetch=false> (ConnectionException: Connection timed out)
    2021-08-07 00:03:54.028 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8724/metric?startTime=1628294496000&endTime=1628294502000&refetch=false> (ConnectionException: Connection timed out)
    2021-08-07 00:03:54.028 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8721/metric?startTime=1628294496000&endTime=1628294502000&refetch=false> (ConnectionException: Connection timed out)
    2021-08-07 00:04:02.219 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8725/metric?startTime=1628294503000&endTime=1628294509000&refetch=false> (ConnectionException: Connection timed out)
    2021-08-07 00:04:10.376 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8723/metric?startTime=1628294510000&endTime=1628294516000&refetch=false> (ConnectionException: Connection timed out)
    2021-08-07 00:04:10.376 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8721/metric?startTime=1628294510000&endTime=1628294516000&refetch=false> (ConnectionException: Connection timed out)
    2021-08-07 00:04:22.664 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8726/metric?startTime=1628294524000&endTime=1628294530000&refetch=false> (ConnectionException: Connection timed out)
    2021-08-07 00:04:30.856 ERROR 1 --- [pool-2-thread-1] c.a.c.s.dashboard.metric.MetricFetcher : Failed to fetch metric from <http://192.168.2.12:8726/metric?startTime=1628294531000&endTime=1628294537000&refetch=false> (ConnectionException: Connection timed out)


    0 讨论(0)
提交回复