Skip to content

Commit 9e63018

Browse files
authored
feat: disable http timeout (#5721)
* feat: update to disable http timeout by default * feat: make http timeout default to 0 * test: correct test case * chore: generate new config doc * test: correct tests
1 parent 594bec8 commit 9e63018

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

config/config.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
| `runtime.compact_rt_size` | Integer | `4` | The number of threads to execute the runtime for global write operations. |
2525
| `http` | -- | -- | The HTTP server options. |
2626
| `http.addr` | String | `127.0.0.1:4000` | The address to bind the HTTP server. |
27-
| `http.timeout` | String | `30s` | HTTP request timeout. Set to 0 to disable timeout. |
27+
| `http.timeout` | String | `0s` | HTTP request timeout. Set to 0 to disable timeout. |
2828
| `http.body_limit` | String | `64MB` | HTTP request body limit.<br/>The following units are supported: `B`, `KB`, `KiB`, `MB`, `MiB`, `GB`, `GiB`, `TB`, `TiB`, `PB`, `PiB`.<br/>Set to 0 to disable limit. |
2929
| `http.enable_cors` | Bool | `true` | HTTP CORS support, it's turned on by default<br/>This allows browser to access http APIs without CORS restrictions |
3030
| `http.cors_allowed_origins` | Array | Unset | Customize allowed origins for HTTP CORS. |
@@ -222,7 +222,7 @@
222222
| `heartbeat.retry_interval` | String | `3s` | Interval for retrying to send heartbeat messages to the metasrv. |
223223
| `http` | -- | -- | The HTTP server options. |
224224
| `http.addr` | String | `127.0.0.1:4000` | The address to bind the HTTP server. |
225-
| `http.timeout` | String | `30s` | HTTP request timeout. Set to 0 to disable timeout. |
225+
| `http.timeout` | String | `0s` | HTTP request timeout. Set to 0 to disable timeout. |
226226
| `http.body_limit` | String | `64MB` | HTTP request body limit.<br/>The following units are supported: `B`, `KB`, `KiB`, `MB`, `MiB`, `GB`, `GiB`, `TB`, `TiB`, `PB`, `PiB`.<br/>Set to 0 to disable limit. |
227227
| `http.enable_cors` | Bool | `true` | HTTP CORS support, it's turned on by default<br/>This allows browser to access http APIs without CORS restrictions |
228228
| `http.cors_allowed_origins` | Array | Unset | Customize allowed origins for HTTP CORS. |
@@ -390,7 +390,7 @@
390390
| `enable_telemetry` | Bool | `true` | Enable telemetry to collect anonymous usage data. Enabled by default. |
391391
| `http` | -- | -- | The HTTP server options. |
392392
| `http.addr` | String | `127.0.0.1:4000` | The address to bind the HTTP server. |
393-
| `http.timeout` | String | `30s` | HTTP request timeout. Set to 0 to disable timeout. |
393+
| `http.timeout` | String | `0s` | HTTP request timeout. Set to 0 to disable timeout. |
394394
| `http.body_limit` | String | `64MB` | HTTP request body limit.<br/>The following units are supported: `B`, `KB`, `KiB`, `MB`, `MiB`, `GB`, `GiB`, `TB`, `TiB`, `PB`, `PiB`.<br/>Set to 0 to disable limit. |
395395
| `grpc` | -- | -- | The gRPC server options. |
396396
| `grpc.bind_addr` | String | `127.0.0.1:3001` | The address to bind the gRPC server. |
@@ -563,7 +563,7 @@
563563
| `grpc.max_send_message_size` | String | `512MB` | The maximum send message size for gRPC server. |
564564
| `http` | -- | -- | The HTTP server options. |
565565
| `http.addr` | String | `127.0.0.1:4000` | The address to bind the HTTP server. |
566-
| `http.timeout` | String | `30s` | HTTP request timeout. Set to 0 to disable timeout. |
566+
| `http.timeout` | String | `0s` | HTTP request timeout. Set to 0 to disable timeout. |
567567
| `http.body_limit` | String | `64MB` | HTTP request body limit.<br/>The following units are supported: `B`, `KB`, `KiB`, `MB`, `MiB`, `GB`, `GiB`, `TB`, `TiB`, `PB`, `PiB`.<br/>Set to 0 to disable limit. |
568568
| `meta_client` | -- | -- | The metasrv client options. |
569569
| `meta_client.metasrv_addrs` | Array | -- | The addresses of the metasrv. |

config/datanode.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ max_concurrent_queries = 0
2727
## The address to bind the HTTP server.
2828
addr = "127.0.0.1:4000"
2929
## HTTP request timeout. Set to 0 to disable timeout.
30-
timeout = "30s"
30+
timeout = "0s"
3131
## HTTP request body limit.
3232
## The following units are supported: `B`, `KB`, `KiB`, `MB`, `MiB`, `GB`, `GiB`, `TB`, `TiB`, `PB`, `PiB`.
3333
## Set to 0 to disable limit.

config/flownode.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ max_send_message_size = "512MB"
3030
## The address to bind the HTTP server.
3131
addr = "127.0.0.1:4000"
3232
## HTTP request timeout. Set to 0 to disable timeout.
33-
timeout = "30s"
33+
timeout = "0s"
3434
## HTTP request body limit.
3535
## The following units are supported: `B`, `KB`, `KiB`, `MB`, `MiB`, `GB`, `GiB`, `TB`, `TiB`, `PB`, `PiB`.
3636
## Set to 0 to disable limit.

config/frontend.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ retry_interval = "3s"
2626
## The address to bind the HTTP server.
2727
addr = "127.0.0.1:4000"
2828
## HTTP request timeout. Set to 0 to disable timeout.
29-
timeout = "30s"
29+
timeout = "0s"
3030
## HTTP request body limit.
3131
## The following units are supported: `B`, `KB`, `KiB`, `MB`, `MiB`, `GB`, `GiB`, `TB`, `TiB`, `PB`, `PiB`.
3232
## Set to 0 to disable limit.

config/standalone.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ max_concurrent_queries = 0
3434
## The address to bind the HTTP server.
3535
addr = "127.0.0.1:4000"
3636
## HTTP request timeout. Set to 0 to disable timeout.
37-
timeout = "30s"
37+
timeout = "0s"
3838
## HTTP request body limit.
3939
## The following units are supported: `B`, `KB`, `KiB`, `MB`, `MiB`, `GB`, `GiB`, `TB`, `TiB`, `PB`, `PiB`.
4040
## Set to 0 to disable limit.

src/cmd/src/frontend.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ mod tests {
440440
441441
[http]
442442
addr = "127.0.0.1:4000"
443-
timeout = "30s"
443+
timeout = "0s"
444444
body_limit = "2GB"
445445
446446
[opentsdb]
@@ -461,7 +461,7 @@ mod tests {
461461
let fe_opts = command.load_options(&Default::default()).unwrap().component;
462462

463463
assert_eq!("127.0.0.1:4000".to_string(), fe_opts.http.addr);
464-
assert_eq!(Duration::from_secs(30), fe_opts.http.timeout);
464+
assert_eq!(Duration::from_secs(0), fe_opts.http.timeout);
465465

466466
assert_eq!(ReadableSize::gb(2), fe_opts.http.body_limit);
467467

src/servers/src/http.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl Default for HttpOptions {
154154
fn default() -> Self {
155155
Self {
156156
addr: "127.0.0.1:4000".to_string(),
157-
timeout: Duration::from_secs(30),
157+
timeout: Duration::from_secs(0),
158158
disable_dashboard: false,
159159
body_limit: DEFAULT_BODY_LIMIT,
160160
is_strict_mode: false,
@@ -1384,7 +1384,7 @@ mod test {
13841384
fn test_http_options_default() {
13851385
let default = HttpOptions::default();
13861386
assert_eq!("127.0.0.1:4000".to_string(), default.addr);
1387-
assert_eq!(Duration::from_secs(30), default.timeout)
1387+
assert_eq!(Duration::from_secs(0), default.timeout)
13881388
}
13891389

13901390
#[tokio::test]

src/servers/tests/http/http_handler_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ async fn test_config() {
386386
387387
[http]
388388
addr = "127.0.0.1:4000"
389-
timeout = "30s"
389+
timeout = "0s"
390390
body_limit = "2GB"
391391
392392
[logging]

tests-integration/tests/http.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ init_regions_parallelism = 16
943943
944944
[http]
945945
addr = "127.0.0.1:4000"
946-
timeout = "30s"
946+
timeout = "0s"
947947
body_limit = "64MiB"
948948
is_strict_mode = false
949949
cors_allowed_origins = []

0 commit comments

Comments
 (0)