It seems room/runtime/src/main/java/androidx/room/RoomDatabase.java is using ConcurrentHashMap which has an issue on Android’s Lollipop release that can lead to lost updates under thread contention. This is further complicated by the fact that we face issues with drops to other repos that forbid its use.
Description
(manually copied from internal b/162303675 )
It seems room/runtime/src/main/java/androidx/room/RoomDatabase.java is using ConcurrentHashMap which has an issue on Android’s Lollipop release that can lead to lost updates under thread contention. This is further complicated by the fact that we face issues with drops to other repos that forbid its use.
We recommend moving away from it. A possible solution is to use a synchronized map (https://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#synchronizedMap%28java.util.Map%29 ).