Skip to content

Commit 8b87be3

Browse files
author
github-actions
committed
update MD by dispatch event pingcap/docs release-cloud
1 parent 9287209 commit 8b87be3

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

markdown-pages/en/tidbcloud/master/develop/dev-guide-timeouts-in-tidb.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,25 @@ TiDB also provides a system variable (`max_execution_time`, `0` by default, indi
7676

7777
## JDBC query timeout
7878

79-
MySQL JDBC's query timeout setting for `setQueryTimeout()` does **_NOT_** work for TiDB, because the client sends a `KILL` command to the database when it detects the timeout. However, the tidb-server is load balanced, and it will not execute this `KILL` command to avoid termination of the connection on a wrong tidb-server. You need to use `MAX_EXECUTION_TIME` to check the query timeout effect.
79+
<CustomContent platform="tidb">
80+
81+
Starting from v6.1.0, when the [`enable-global-kill`](/tidb-configuration-file.md#enable-global-kill-new-in-v610) configuration item is set to its default value `true`, you can use the `setQueryTimeout()` method provided by MySQL JDBC to control the query timeout.
82+
83+
> **Note:**
84+
>
85+
> When your TiDB version is earlier than v6.1.0 or [`enable-global-kill`](/tidb-configuration-file.md#enable-global-kill-new-in-v610) is set to `false`, `setQueryTimeout()` does not work for TiDB. This is because the client sends a `KILL` command to the database when it detects the query timeout. However, because the TiDB service is load balanced, TiDB does not execute the `KILL` command to avoid termination of the connection on a wrong TiDB node. In such cases, you can use `max_execution_time` to control query timeout.
86+
87+
</CustomContent>
88+
89+
<CustomContent platform="tidb-cloud">
90+
91+
Starting from v6.1.0, when the [`enable-global-kill`](https://docs.pingcap.com/tidb/stable/tidb-configuration-file/#enable-global-kill-new-in-v610) configuration item is set to its default value `true`, you can use the `setQueryTimeout()` method provided by MySQL JDBC to control the query timeout.
92+
93+
> **Note:**
94+
>
95+
> When your TiDB version is earlier than v6.1.0 or [`enable-global-kill`](https://docs.pingcap.com/tidb/stable/tidb-configuration-file/#enable-global-kill-new-in-v610) is set to `false`, `setQueryTimeout()` does not work for TiDB. This is because the client sends a `KILL` command to the database when it detects the query timeout. However, because the TiDB service is load balanced, TiDB does not execute the `KILL` command to avoid termination of the connection on a wrong TiDB node. In such cases, you can use `max_execution_time` to control query timeout.
96+
97+
</CustomContent>
8098

8199
TiDB provides the following MySQL-compatible timeout control parameters.
82100

0 commit comments

Comments
 (0)