ricoberger / script_exporter

Prometheus exporter to execute scripts and collect metrics from the output or the exit status.
MIT License
354 stars 82 forks source link

Fix Race Condition when Cache is Used #166

Closed ricoberger closed 2 weeks ago

ricoberger commented 2 weeks ago

When to requests were accessing the cache during the same time, there was a race condition because of the concurrent access to the map which holds the cached entries.

This is now fixed by adding a lock for the cache, so that multiple requests can not access the cache in parallel.

Fixes #157