Repository navigation
[#325] Release the metrics cache lock when a client disconnects - #725
Open
LoayTarek5 wants to merge 1 commit into
Open
LoayTarek5 wants to merge 1 commit into
LoayTarek5 wants to merge 1 commit into
Conversation
Author
|
@fheikens , @jesperpedersen, also found a few related things while working on this (reset spinning with no timeout, the writes in output_all_metrics not being checked, the http client spinning when the server closes before the header), i will open separate issues for them |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #325
if a client hangs up while /metrics is being served, the metrics child gets killed by SIGPIPE while it holds the prometheus cache lock, so the lock is never released, after that every scrape waits blocking_timeout and gets an empty reply, and
pgexporter-cli clear prometheushangs the main process since it spins on the same lockso now the http children ignore SIGPIPE, so the write fails with EPIPE instead, and metrics_page releases the lock before every goto error inside the locked section, same as bridge.c got in #635, both are needed, with only one of them the test still fails
also added test_http_metrics_client_reset, it resets the connection mid scrape and checks the next scrape still gets a 200, my AUTHORS entry is in #702