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

Correct error handling on exit when serving prometheus metrics #61

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

antifuchs
Copy link
Contributor

@antifuchs antifuchs commented Sep 29, 2024

The logic for serving prometheus metrics was somewhat broken: It would attempt to check that the cancellation context didn't indicate that we should exit, but it would only do that before starting to serve.

Instead, first serve, and if serve returns a fault, check whether we're meant to exit. Oops.

The logic for serving prometheus metrics was somewhat broken: It would
attempt to check that the cancellation context didn't indicate that we
should exit, but it would only do that _before_ starting to serve.

Instead, we must serve, and if serve returns a fault, check whether
we're meant to exit. Oops.
@antifuchs antifuchs added this pull request to the merge queue Sep 29, 2024
Merged via the queue into main with commit d4330c5 Sep 29, 2024
9 checks passed
@antifuchs antifuchs deleted the fix-prometheus-exit-race branch September 29, 2024 15:53
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.

1 participant