Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - fetch: make request timeout configurable #5464

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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