7.3.5. Request timeout¶
New in version 6.0.2.
You can set timeout to each request.
If a request isn't completed until the specified timeout, the request is canceled. If you don't set timeout, the request is processed until the request is completed.
Request timeout feature is useful when you implement timeout on client side. If you only implement timeout only on client side, the request keeps processing after client stops waiting response. It uses needless resources. If you set timeout to the request, the request will be canceled soon.
22.214.171.124. How to set timeout to request¶
All commands accept
request_timeout parameter. You can set timeout
to request by adding
Unit of timeout out value is second. You can set timeout less than 1
second by using decimal such as
0.1 means 100
Here is an example to set
5.5 seconds timeout to a request:
select Users --request_timeout 5.5
126.96.36.199. Return code on timeout¶
If the request is timed out,
Return code is returned in response header.
Here is an example response on timeout:
[ [ -77, 1459846102.63304, 0.000220775604248047, "[request-canceler] a request is canceled: <0x7fa0d5d7ed00>" ] ]
See Output format for response header.
188.8.131.52. Enable request timeout by default¶
If the default request timeout is larger than 0 second, the default request timeout is used as request timeout for all requests.
You can overwrite the default request timeout by specifying
request_timeout parameter to request. If the default request
timeout is 3 seconds and
request_timeout parameter is 1 second,
the request is canceled after 1 second.