---
title: 断链报错 &quot;Read timed out&quot; 的问题排查-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于断链报错 &quot;Read timed out&quot; 的问题排查相关的常见问题和使用技巧，帮助您快速解决断链报错 &quot;Read timed out&quot; 的问题排查的难题。
---
切换语言

- 简体中文
- English

划线反馈

# 断链报错 "Read timed out" 的问题排查

更新时间：2026-06-04 01:56

适用版本： V2.1.x、V2.2.x、V3.1.x、V3.2.x、V4.0.x、V4.1.x、V4.2.x 内容类型：Troubleshoot  

## 问题现象

应用使用 ODP-Sharding 连接 OceanBase 数据库，业务执行报错：`Server connection execute error: Read timed out`。

![1](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/connection/aa02t02-troubleshooting-the-issue-of-read-timed-out-error-caused-by-a-broken-chain.png)

## 问题原因

SQL 执行较慢，触发了 `Socket timeout`。

## 排查步骤

- 查看 ODP comm-error 日志，发现有报错：`Communications link failure`，显示链接在空闲 5 秒后报错。

  ```shell
  Communications link failure
  The Last packet successfully received from the server was 5,008 milliseconds ago.
  The last packet sent successfully to the server was 5,005 milliseconds ago.

  ```
 - 查看 ODP digest 日志，查看 SQL 执行的具体耗时信息，看到 SQL 执行了 5023474 us，即 5 秒。

  ```shell
  2024-01-30 16:00:23,632,14031ca31706601614999100516596,xx.xx.xx.xx,db_xx,dpst...,UPDATE,/*
  -DBP: $SYS=(TRACE (14031ca31706601614999100516596#xx.xx.xx.xx))*//*+DBP:
  §ROUTE={GROUP ID (29) &2CTABLE NAME (dpst...))* /UPDATE dpst... SET ...
  N,Y,x0e45035317066016185932701,N,0,5023474,42,34,74,2,0,0,tb_xx,0

  ```
 - 查看 OBProxy digest 日志，看到 SQL 执行了 5005400 us，即 5 秒，然后失败。

  ```shell
  2024-01-30 16:00:23.614698, undefined...dpst...,OB_MYSQL.,dpst...,COM_QUERY,UPDATE,failed,UPDATE dpst... SET ...5005400us,22us,0us,0us,Y0-7FC9A384EC90

  ```
 - 查看 OCP 中 SQL 监控信息，看到该语句在数据库中的耗时超过 5 秒。说明 SQL 执行耗时超过 5 秒，触发了 socket timeout。

## 解决方法

- 对 SQL 进行调优。
 - 调整 socket timeout 设置。

## 适用版本

OceanBase 数据库所有版本。

Previous

[使用 DBLink 访问 LOB 类型时遇到报错：-4007, Not supported feature or function 的原因和解决方法](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000001260056)

Next

[OceanBase 数据库连接出现 Access denied for user 'xxxx'@'xxxx' (using password: YES) 错误](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000006085084) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
