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

feat(globalconfig): Only report upstream errors after elapsed interval #2628

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

iker-barriocanal
Copy link
Contributor

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.

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.
@iker-barriocanal iker-barriocanal requested a review from a team October 18, 2023 12:33
@iker-barriocanal iker-barriocanal self-assigned this Oct 18, 2023
@@ -164,6 +170,8 @@ impl GlobalConfigService {
internal_rx,
upstream,
fetch_handle: SleepHandle::idle(),
last_fetched: Instant::now(),
upstream_failure_interval: Duration::from_secs(35),
Copy link
Contributor Author

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).

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@jjbayer jjbayer left a 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),
Copy link
Member

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?

@iker-barriocanal iker-barriocanal merged commit a378fff into master Oct 18, 2023
20 checks passed
@iker-barriocanal iker-barriocanal deleted the iker/feat/globalconfig-error-interval branch October 18, 2023 13:50
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.

Improve global config fetching error logging
2 participants