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(metadata): add timeout option #293

Merged
merged 2 commits into from
Jul 21, 2023
Merged

feat(metadata): add timeout option #293

merged 2 commits into from
Jul 21, 2023

Conversation

apricote
Copy link
Member

Some users might try to access the metadata service even though their networking setup breaks connectivity. This might lead to forever stalled connections. By setting a timeout we can error out instead of waiting indefinitely.

In my tests the metadata service responded in 12-40ms, so a default timeout of 1 second should be enough to only fail when the metadata service is actually unavailable.

@apricote apricote added Improvement backport release-1.x Open PR against release-1.x with these changes after the PR is merged. labels Jul 20, 2023
@apricote apricote self-assigned this Jul 20, 2023
hcloud/metadata/client.go Outdated Show resolved Hide resolved
@apricote apricote marked this pull request as ready for review July 21, 2023 10:42
@apricote apricote requested a review from a team as a code owner July 21, 2023 10:42
@apricote apricote merged commit 913bf74 into main Jul 21, 2023
3 checks passed
@apricote apricote deleted the metadata-timeout branch July 21, 2023 11:25
github-actions bot pushed a commit that referenced this pull request Jul 21, 2023
apricote added a commit that referenced this pull request Jul 21, 2023
(cherry picked from commit 913bf74)

Co-authored-by: Julian Tölle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-1.x Open PR against release-1.x with these changes after the PR is merged. Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants