From b9126033643679572d94c9ee083bede2a7a8e502 Mon Sep 17 00:00:00 2001 From: Tatiana Nesterenko Date: Wed, 28 Aug 2024 12:12:34 +0100 Subject: [PATCH 1/3] config: Fix zap level constant There was an error: Cannot use 'zap.FatalLevel' (type Level) as the type Level Signed-off-by: Tatiana Nesterenko --- cmd/neofs-rest-gw/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/neofs-rest-gw/config.go b/cmd/neofs-rest-gw/config.go index 08953b9..3e48b81 100644 --- a/cmd/neofs-rest-gw/config.go +++ b/cmd/neofs-rest-gw/config.go @@ -449,7 +449,7 @@ func newLogger(v *viper.Viper) *zap.Logger { } l, err := c.Build( - zap.AddStacktrace(zap.NewAtomicLevelAt(zap.FatalLevel)), + zap.AddStacktrace(zap.NewAtomicLevelAt(zapcore.FatalLevel)), ) if err != nil { panic(fmt.Sprintf("build zap logger instance: %v", err)) From b3279d1196b08079619f6d10befb4df1d431c81a Mon Sep 17 00:00:00 2001 From: Tatiana Nesterenko Date: Wed, 28 Aug 2024 12:45:29 +0100 Subject: [PATCH 2/3] config: Edit the value of `node-dial-timeout` in the example file Signed-off-by: Tatiana Nesterenko --- config/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index 3d7bc77..e25cd88 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -19,7 +19,7 @@ logger: pool: # Timeout to dial node. - node-dial-timeout: 5s + node-dial-timeout: 10s # Timeout to check node health during rebalance. healthcheck-timeout: 5s # Interval to check nodes' health. From 1ab470e333ed2f27480c1a15ba90dfdb41e29a86 Mon Sep 17 00:00:00 2001 From: Tatiana Nesterenko Date: Wed, 28 Aug 2024 12:19:46 +0100 Subject: [PATCH 3/3] config: Set the default server read/write timeouts to 60 sec Signed-off-by: Tatiana Nesterenko --- cmd/neofs-rest-gw/config.go | 4 ++-- config/config.yaml | 4 ++-- docs/gate-configuration.md | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/neofs-rest-gw/config.go b/cmd/neofs-rest-gw/config.go index 3e48b81..aba4b6e 100644 --- a/cmd/neofs-rest-gw/config.go +++ b/cmd/neofs-rest-gw/config.go @@ -146,8 +146,8 @@ func config() *viper.Viper { flagSet.String(cfgTLSCertFile, "", "TLS certificate file to use; note that if you want to start HTTPS server, you should also set up --"+cmdListenAddress+" and --"+cfgTLSKeyFile) flagSet.String(cfgTLSKeyFile, "", "TLS key file to use; note that if you want to start HTTPS server, you should also set up --"+cmdListenAddress+" and --"+cfgTLSCertFile) flagSet.Duration(cfgEndpointKeepAlive, 3*time.Minute, "sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)") - flagSet.Duration(cfgEndpointReadTimeout, 30*time.Second, "maximum duration before timing out read of the request") - flagSet.Duration(cfgEndpointWriteTimeout, 30*time.Second, "maximum duration before timing out write of the response") + flagSet.Duration(cfgEndpointReadTimeout, 60*time.Second, "maximum duration before timing out read of the request") + flagSet.Duration(cfgEndpointWriteTimeout, 60*time.Second, "maximum duration before timing out write of the response") flagSet.String(cfgEndpointExternalAddress, "", "the full URL address needs to be shown in the API documentation") // init server flags diff --git a/config/config.yaml b/config/config.yaml index e25cd88..5678092 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -73,9 +73,9 @@ server: # It prunes dead TCP connections ( e.g. closing laptop mid-download). keep-alive: 3m # Maximum duration before timing out read of the request. - read-timeout: 30s + read-timeout: 60s # Maximum duration before timing out write of the response. - write-timeout: 30s + write-timeout: 60s - address: localhost:8080 external-address: http://localhost:8090 diff --git a/docs/gate-configuration.md b/docs/gate-configuration.md index 93feba0..81a0ac2 100644 --- a/docs/gate-configuration.md +++ b/docs/gate-configuration.md @@ -32,8 +32,8 @@ server: key: /path/to/tls/key ca-certificate: /path/to/tls/ca keep-alive: 3m - read-timeout: 30s - write-timeout: 30s + read-timeout: 60s + write-timeout: 60s cleanup-timeout: 10s graceful-timeout: 15s max-header-size: 1000000 @@ -48,8 +48,8 @@ server: | `listen-limit` | `int` | `0` | Limit the number of outstanding requests. `0` means no limit | | | `endpoint.[0].address` | `string` | `localhost:8080` | The IP and port to listen on. | | `endpoint.[0].keep-alive` | `duration` | `3m` | Sets the TCP keep-alive timeouts on accepted connections. | -| `endpoint.[0].read-timeout` | `duration` | `30s` | Maximum duration before timing out read of the request. It prunes dead TCP connections (e.g. closing laptop mid-download). | -| `endpoint.[0].write-timeout` | `duration` | `30s` | Maximum duration before timing out write of the response. | +| `endpoint.[0].read-timeout` | `duration` | `60s` | Maximum duration before timing out read of the request. It prunes dead TCP connections (e.g. closing laptop mid-download). | +| `endpoint.[0].write-timeout` | `duration` | `60s` | Maximum duration before timing out write of the response. | | `endpoint.[0].tls.enabled` | `bool` | `false` | Use TLS for a gRPC connection (min version is TLS 1.2). | | `endpoint.[0].tls.certificate` | `string` | | The certificate file to use for secure connections. | | `endpoint.[0].tls.key` | `string` | | The private key file to use for secure connections (without passphrase). |