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

Make connectivity check more robust #91

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Make connectivity check more robust #91

merged 1 commit into from
Apr 22, 2024

Conversation

kristian-lesko
Copy link
Contributor

Some endpoints chosen for connectivity check may return an error, for example, due to rate limits being exceeded. However, as long as the given website could be reached, it means the connection's working and fallback to NAT Gateway should not be initiated. Such occurrences can be simply logged but treated as check success.

Add a User-Agent header to connection check requests, which also prevents some websites from returning an error in the first place.

Some endpoints chosen for connectivity check may return an error,
for example, due to rate limits being exceeded. However, as long
as the given website could be reached, it means the connection's
working and fallback to NAT Gateway should not be initiated. Such
occurrences can be simply logged but treated as check success.

Add a `User-Agent` header to connection check requests, which also
prevents some websites from returning an error in the first place.
@kristian-lesko kristian-lesko requested review from a team as code owners April 22, 2024 13:57
Copy link
Member

@bwhaley bwhaley left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Out of curiosity, what URLs are you hitting that are returning rate limit errors? I wouldn't think that alternat alone would bump in to any rate limits, esp with URLs like www.google.com or www.example.com.

@bwhaley bwhaley merged commit 4d099ec into chime:main Apr 22, 2024
@kristian-lesko kristian-lesko deleted the connectivity_check branch April 23, 2024 06:47
@kristian-lesko
Copy link
Contributor Author

We were using GitHub API as one of the check URLs, where the rate limit is 60 requests per hour without authentication. An endpoint hosted by CloudFlare, in turn, returned Forbidden errors when the User-Agent was not set.

Thanks for the merge!

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.

2 participants