PromPHP / prometheus_client_php

Prometheus instrumentation library for PHP applications
https://prometheus.io/docs/concepts/metric_types/
Apache License 2.0
415 stars 91 forks source link

Avoid possible infinite loops on APCu eviction #136

Closed TobiasBengtsson closed 6 months ago

TobiasBengtsson commented 9 months ago

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)