Skip to content

Add deadlock prevention during metric registration - #1079

Open
suligap wants to merge 2 commits into
prometheus:masterfrom
suligap:deadlock-prevention
Open

Add deadlock prevention during metric registration#1079
suligap wants to merge 2 commits into
prometheus:masterfrom
suligap:deadlock-prevention

Conversation

@suligap

Copy link
Copy Markdown
Contributor

Detect deadlocks during the library misuse, eg. by injecting code into the critical sections that itself might want to obtain the relevant lock.

A follow up to #1076.

@csmarchbanks

Copy link
Copy Markdown
Member

Just want to say I have been busy this week and am out next week, but I will get to this, and thank you for your contributions!

Detects and prevents deadlocks during the library misuse, eg. by
injecting code into the critical sections that itself might want to
obtain the relevant lock.
A follow up to prometheus#1076.
Signed-off-by: Przemysław Suliga <mail@suligap.net>
It's hard to justify the overhead of double locking there.
Signed-off-by: Przemysław Suliga <mail@suligap.net>
@suligapsuligap changed the title Add deadlock detectionAdd deadlock prevention during metric registrationDec 8, 2024
@suligap

Copy link
Copy Markdown
ContributorAuthor

No worries, nothing urgent here and thanks. I thought about it a bit more and ended up pulling out the deadlock prevention from the "hottest" path: metrics.py and values.py. It's quite hard to justify the overhead of this double locking approach there. But I think it's not an issue in registry.py.

Sign up for freeto 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

@suligap@csmarchbanks