Open lucafavatella opened 6 years ago
A following
exometer_cache:write
may update the cache ETS entry, though it looks to me this is not the intended behaviour hence the report.
Actually I see that the piece of code that I understand it is supposed to call exometer_cache:write
on a metric-datapoint meant to be cached is conditionally called based on the metric-datapoint having a cached value, so this seems an issue.
When a process calls
exometer_cache:write/{3,4}
, it:exometer_cache
process to start a timer for the (metric-datapoint keyed) cache deletion, and to update (ets:update_element
) the relevant field in the ETS entry with the timer ref;ets:insert
) the ETS entry, without timer ref.Depending on the scheduling of the process calling
exometer_cache:write
and theexometer_cache
process (I am excluding process death for simplicity), the cache ETS entry may or may not have the timer ref. If the cache ETS entry has no timer ref, the cache ETS entry is not deleted when the timer fires.A following
exometer_cache:write
may update the cache ETS entry, though it looks to me this is not the intended behaviour hence the report.Sample minimal example (notice the
ets:select_delete
calls):