-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat(globalconfig): Only report upstream errors after elapsed interval #2628
feat(globalconfig): Only report upstream errors after elapsed interval #2628
Conversation
Especially during deployments, Relay sometimes faces some 503s or timeouts from upstream, and reports an error. Having a handful of such errors is noisy and doesn't help to identify when problems really exist. This change introduces an interval the global config service has to wait before reporting such errors, while consistently failing fetches. Note that the interval does not impact other type of errors, like failure to send requests to upstream (e.g. network is down) or global config missing from the response. These errors are consistent and should be reported as early as possible.
@@ -164,6 +170,8 @@ impl GlobalConfigService { | |||
internal_rx, | |||
upstream, | |||
fetch_handle: SleepHandle::idle(), | |||
last_fetched: Instant::now(), | |||
upstream_failure_interval: Duration::from_secs(35), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
35 is arbitrary, but should have time for 3 requests (after 10s each).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in Config
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may not need it for now, but I'll keep this in mind to address it in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make the interval configurable, apart from that LGTM!
@@ -164,6 +170,8 @@ impl GlobalConfigService { | |||
internal_rx, | |||
upstream, | |||
fetch_handle: SleepHandle::idle(), | |||
last_fetched: Instant::now(), | |||
upstream_failure_interval: Duration::from_secs(35), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in Config
?
Especially during deployments, Relay sometimes faces some 503s or timeouts from upstream, and reports an error. Having a handful of such errors is noisy and doesn't help to identify when problems really exist.
This change introduces an interval the global config service has to wait before reporting such errors, while consistently failing fetches.
Note that the interval does not impact other types of errors, like failure to send requests to upstream (e.g. network is down) or global config missing from the response. These errors are consistent and should be reported as early as possible.
Resolves #2609.