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

Avoid possible infinite loops on APCu eviction #136

Merged

Conversation

TobiasBengtsson
Copy link
Contributor

If we are unlucky with an APCu eviction at the wrong moment, and no other thread writing to the same metric, we can get stuck in an infinite loop where apcu_fetch will always return false.

Fix by applying the same strategy as if apcu_fetch was false in the first place (before doing compare-and-swap)

TobiasBengtsson and others added 2 commits November 9, 2023 22:50
If we are unlucky with an APCu eviction at the wrong moment, and no
other thread writing to the same metric, we can get stuck in an
infinite loop where apcu_fetch will always return false.

Fix by applying the same strategy as if apcu_fetch was false in the
first place (before doing compare-and-swap)

Signed-off-by: Tobias Bengtsson <[email protected]>
Copy link
Member

@LKaemmerling LKaemmerling left a comment

Choose a reason for hiding this comment

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

Hey @TobiasBengtsson,

thank you! I have a small question.

src/Prometheus/Storage/APC.php Show resolved Hide resolved
@LKaemmerling LKaemmerling merged commit a09ea80 into PromPHP:main Feb 1, 2024
31 checks passed
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