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

Increase default connection timeout #152

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

End-rey
Copy link
Contributor

@End-rey End-rey commented Aug 29, 2024

Closes #147.

As I understand it, there is only a connection to the server and the value has increased significantly. Maybe put 15 seconds?

@End-rey End-rey requested review from 532910 and roman-khimov August 29, 2024 12:25
Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 3.03%. Comparing base (3f84a08) to head (34afd00).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
cmd/neo-exporter/config.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #152   +/-   ##
======================================
  Coverage    3.03%   3.03%           
======================================
  Files          18      18           
  Lines         987     987           
======================================
  Hits           30      30           
  Misses        955     955           
  Partials        2       2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is an imbalance now between chain.dial_timeout and metrics.interval which can lead to resource leak. In general, dial_timeout can't be less than the interval since new scraping attempt shouldn't be performed before the old one has finished. Either it's handled by exported internally (skip the interval tick if still collecting), or we shouldn't have this 60/15s relation in the config.
@532910, @smallhive?

cmd/neo-exporter/config.go Show resolved Hide resolved
@@ -33,7 +33,7 @@ const (

func DefaultConfiguration(cfg *viper.Viper) {
cfg.SetDefault(prefix+delimiter+cfgNeoRPCEndpoint, "")
cfg.SetDefault(prefix+delimiter+cfgNeoRPCDialTimeout, 5*time.Second)
cfg.SetDefault(prefix+delimiter+cfgNeoRPCDialTimeout, time.Minute)

cfg.SetDefault(cfgMetricsEndpoint, ":16512")
cfg.SetDefault(cfgMetricsInterval, 15*time.Minute)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is for timeout changes, let's add one more commit and change this to 15*time.Second.
The example YAML config contains 15s and I doubt 15 minutes is a good interval between metric gathering for default value 😅

@smallhive
Copy link
Contributor

I think there is an imbalance now between chain.dial_timeout and metrics.interval which can lead to resource leak. In general, dial_timeout can't be less than the interval since new scraping attempt shouldn't be performed before the old one has finished. Either it's handled by exported internally (skip the interval tick if still collecting), or we shouldn't have this 60/15s relation in the config. @532910, @smallhive?

The collection ticks executes after interval, but only if the previous execution is done. It works because we do it inside one for.

@roman-khimov
Copy link
Member

only if the previous execution is done

OK then.

@roman-khimov roman-khimov merged commit 06b2a07 into master Aug 30, 2024
15 of 16 checks passed
@roman-khimov roman-khimov deleted the 147-default-timeouts-are-extremely-aggressive branch August 30, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

default timeouts are extremely aggressive
3 participants