Skip to content

Commit

Permalink
fetch: make request timeout configurable (#5464)
Browse files Browse the repository at this point in the history
## Motivation
After merging #5462, it might make sense to try and reduce request timeout, as the deadlines will no longer be hit due to long transfers

## Changes
Add `request-timeout` key to the `fetch` config. Also, fix a typo
  • Loading branch information
ivan4th committed Jan 19, 2024
1 parent f38f2d1 commit 5dd7dea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ configuration is as follows:

### Improvements

* [#5464](https://github.com/spacemeshos/go-spacemesh/pull/5464) Make fetch request timeout configurable.
* [#5467](https://github.com/spacemeshos/go-spacemesh/pull/5467)
Fix a bug that could cause ATX sync to stall because of exhausted limit of concurrent requests for dependencies.
Fetching dependencies of an ATX is not limited anymore.
Fetching dependencies of an ATX is not limited anymore.

## Release v1.3.3

Expand Down
6 changes: 3 additions & 3 deletions fetch/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ func (s ServerConfig) toOpts() []server.Opt {
type Config struct {
BatchTimeout time.Duration
BatchSize, QueueSize int
RequestTimeout time.Duration
MaxRetriesForRequest int
EnableServesMetrics bool `mapstructure:"servers-metrics"`
RequestTimeout time.Duration `mapstructure:"request-timeout"`
EnableServerMetrics bool `mapstructure:"servers-metrics"`
ServersConfig map[string]ServerConfig `mapstructure:"servers"`
PeersRateThreshold float64 `mapstructure:"peers-rate-threshold"`
GetAtxsConcurrency int64 // The maximum number of concurrent requests to get ATXs.
Expand Down Expand Up @@ -289,7 +289,7 @@ func (f *Fetch) registerServer(
server.WithTimeout(f.cfg.RequestTimeout),
server.WithLog(f.logger),
}
if f.cfg.EnableServesMetrics {
if f.cfg.EnableServerMetrics {
opts = append(opts, server.WithMetrics())
}
opts = append(opts, f.cfg.getServerConfig(protocol).toOpts()...)
Expand Down

0 comments on commit 5dd7dea

Please sign in to comment.