Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7192e0a8 authored by tsaichristine's avatar tsaichristine
Browse files

Remove locks from StateManager to avoid race condition

A race condition is introduced in ValueMetric due to StateManager's
locks. When StateManager processes a log event, it notifies all
listeners (metric producers) if a state has changed. In ValueMetric, a
state change eventually requires querying through a Statemanager
function that is held by the same lock as StateManager::onLogEvent.

To fix this, we can remove the locks in StateManager and use the locks
in StatsLogProcessor to protect StateManager objects. However, we have
to ensure that the path to StateManager function calls all originate
from StatsLogProcessor.

Test: bit statsd_test:*
Bug: 145838132
Change-Id: Ie5b747961ffa4cd5c78e86fa5f78472e29a972dd
parent f3d0c6f8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment