Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] statistics: fix crash when creating a series stat
Under normal circumstances, when a statistic is updated, we first search whether it exists, and if not, we add it to the statistics hash. However, due to the way it is implemented, searching and adding a statistic is not atomic, hence, with high concurrency, when adding a new statistic, we might already find an existing one there. In this case, the code tries to return that statistic in the `pvar` parameter - however, that parameter might be a (r/o) function, hence a crash happens. This commit fixes the crash. Close #3136 However, it returns 0, as if the statistic was properly added - the problem with this approach is that from the caller's perspective, we do not know whether the statistic was already there or not, to free the existing structure - hence this might result into a leak. We are still working on a solution for this. (cherry picked from commit 4640465)
- Loading branch information